:root{--bg:#f3f5f8;--sidebar:#152033;--sidebar2:#1f2d46;--text:#172033;--muted:#6b7280;--line:#e5e7eb;--primary:#2563eb;--danger:#dc2626;--warning:#d97706;--success:#15803d;--card:#fff}
*{box-sizing:border-box}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans TC",Arial,sans-serif;background:var(--bg);color:var(--text);font-size:15px}.layout{display:flex;min-height:100vh}.sidebar{width:260px;background:var(--sidebar);color:#e5e7eb;position:fixed;inset:0 auto 0 0;overflow:auto}.brand{padding:20px;font-size:18px;font-weight:700;background:var(--sidebar2);border-bottom:1px solid rgba(255,255,255,.08)}.menu-group{padding:18px 18px 6px;color:#9ca3af;font-size:13px;font-weight:700}.menu-link{display:block;color:#e5e7eb;text-decoration:none;padding:9px 18px;border-left:3px solid transparent}.menu-link:hover{background:rgba(255,255,255,.08);border-left-color:#60a5fa}.main{margin-left:260px;width:calc(100% - 260px);padding:20px}.topbar{background:#fff;border:1px solid var(--line);border-radius:12px;padding:14px 18px;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.topbar a{color:var(--primary);text-decoration:none}.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:18px;margin-bottom:16px;box-shadow:0 1px 2px rgba(15,23,42,.04)}.grid{display:grid;gap:16px}.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.grid.cards{grid-template-columns:repeat(4,minmax(0,1fr))}.stat-title{color:var(--muted);font-size:14px}.stat-value{font-size:36px;font-weight:700;margin-top:8px}.big-money{font-size:30px;font-weight:700}.toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;gap:12px}.toolbar form{flex:1}.form-control,.form-select{width:100%;padding:9px 10px;border:1px solid #d1d5db;border-radius:8px;background:#fff;font-size:14px}.form-control.small,.form-select.small{min-width:120px;padding:7px 8px}.search{max-width:360px}.form-label,label{display:block;margin-bottom:6px;font-weight:600}.form .grid{margin-bottom:12px}.form-actions{margin-top:16px}.btn{display:inline-block;border:1px solid #d1d5db;background:#fff;color:#111827;text-decoration:none;border-radius:8px;padding:8px 12px;cursor:pointer;font-size:14px}.btn-primary{background:var(--primary);color:#fff;border-color:var(--primary)}.btn-warning{background:var(--warning);color:#fff;border-color:var(--warning)}.btn-danger{background:var(--danger);color:#fff;border-color:var(--danger)}.w100{width:100%}.alert{padding:12px 14px;border-radius:10px;margin-bottom:12px}.alert-success{background:#dcfce7;color:#166534}.alert-danger{background:#fee2e2;color:#991b1b}.alert-warning{background:#fef3c7;color:#92400e}.muted{color:var(--muted)}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;background:#fff}th,td{padding:10px;border-bottom:1px solid var(--line);vertical-align:top;white-space:nowrap}th{background:#f9fafb;text-align:left;font-weight:700}.item-table td{white-space:nowrap}.line-amount{text-align:right}.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#e0e7ff,#f8fafc)}.login-card{width:390px;background:#fff;border:1px solid var(--line);border-radius:16px;padding:28px;box-shadow:0 20px 60px rgba(15,23,42,.12)}.login-card h1{font-size:22px;margin:0 0 18px}.login-card label{margin-top:12px}.login-card button{margin-top:18px}h1,h2{margin-top:0}h2{font-size:18px;margin-bottom:12px}@media(max-width:980px){.sidebar{position:relative;width:100%;height:auto}.layout{display:block}.main{margin-left:0;width:100%}.grid.two,.grid.cards{grid-template-columns:1fr}}
.inline-form{display:inline;margin:0}.actions{white-space:nowrap}.link-danger{border:0;background:none;color:var(--danger);padding:0;margin:0 0 0 8px;cursor:pointer;text-decoration:underline;font:inherit}.logo-preview{max-width:240px;max-height:120px;border:1px solid var(--line);background:#fff;padding:8px;border-radius:8px}.mt-2{margin-top:8px}.form-check{display:block}.print-body{background:#e5e7eb}.print-toolbar{position:sticky;top:0;background:#fff;border-bottom:1px solid var(--line);padding:10px 16px;display:flex;gap:8px;z-index:5}.print-sheet{background:#fff;margin:18px auto;padding:18mm;box-shadow:0 8px 30px rgba(0,0,0,.12)}.print-sheet.a4{width:210mm;min-height:297mm}.quote-header{display:flex;gap:18px;align-items:flex-start;border-bottom:2px solid #111;padding-bottom:12px;margin-bottom:12px}.quote-logo{width:130px;max-height:80px;object-fit:contain}.quote-header h1{font-size:26px;margin:0 0 6px}.doc-title{text-align:center;font-size:24px;margin:12px 0}.print-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 18px;margin:12px 0}.print-table th,.print-table td{border:1px solid #111;padding:6px 8px;white-space:normal}.print-table th{background:#f3f4f6}.num{text-align:right}.print-totals{width:280px;margin:12px 0 12px auto;font-size:16px}.print-totals div{display:flex;justify-content:space-between;border-bottom:1px solid #999;padding:4px 0}.print-totals .grand{font-size:20px;font-weight:700}.print-note{border:1px solid #d1d5db;padding:10px;margin-top:12px;white-space:normal}.print-footer-text{text-align:center;margin-top:20px}.signature-row{display:grid;grid-template-columns:repeat(3,1fr);gap:40px;margin-top:40px}.signature-row div{border-top:1px solid #111;text-align:center;padding-top:8px}.dotmatrix-sheet{background:#fff;margin:18px auto;padding:12px;width:fit-content;max-width:100%;font-family:"Courier New","PMingLiU",monospace;font-size:13px;line-height:1.25;white-space:pre;box-shadow:0 8px 30px rgba(0,0,0,.12)}@media print{body{background:#fff}.print-toolbar{display:none}.print-sheet{box-shadow:none;margin:0;padding:10mm}.print-sheet.a4{width:auto;min-height:auto}.dotmatrix-sheet{box-shadow:none;margin:0;padding:0;font-size:12pt;line-height:1.2}@page{margin:8mm}}
.check-group{display:flex;flex-wrap:wrap;gap:10px 16px;padding:9px 10px;border:1px solid #d1d5db;border-radius:8px;background:#fff;min-height:40px}.check-inline{display:inline-flex;align-items:center;gap:6px;font-weight:500;margin:0}.check-inline input{margin:0}
.search-panel{padding:14px 16px}.search-title{font-weight:700;margin-bottom:10px}.filter-grid{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:12px}.filter-grid label{font-size:13px;color:var(--muted);margin-bottom:4px}.search-actions{margin-top:12px}.quote-template-sheet{width:210mm;min-height:297mm;padding:13mm 14mm;font-family:"PMingLiU","MingLiU","Noto Serif TC",serif;color:#111}.qt-top{display:flex;justify-content:space-between;align-items:flex-start;min-height:24mm}.qt-company{font-size:13px;line-height:1.55}.qt-company-name{font-size:22px;font-weight:700;letter-spacing:1px}.qt-logo{max-width:36mm;max-height:20mm;object-fit:contain}.qt-title{text-align:center;font-size:24px;margin:2mm 0 1mm;letter-spacing:3px}.qt-sub{text-align:right;font-size:12px;margin-bottom:2mm}.qt-meta,.qt-items{width:100%;border-collapse:collapse;font-size:13px}.qt-meta td{border:1px solid #111;padding:5px 6px;height:28px}.qt-meta .label{width:29mm;font-weight:700;white-space:nowrap}.qt-items{margin-top:2mm}.qt-items th,.qt-items td{border:1px solid #111;padding:4px 6px;vertical-align:top}.qt-items th{text-align:center;background:#fff;font-weight:700}.qt-items td{height:23px}.qt-items .idx{width:12mm;text-align:center}.qt-items .name{width:86mm;white-space:normal}.qt-items .price{width:23mm}.qt-items .qty{width:18mm}.qt-items .amount{width:27mm}.qt-items .note{width:26mm}.qt-items .num{text-align:right}.qt-total td{font-weight:700}.qt-notices{margin-top:4mm;font-size:12px;line-height:1.45}.qt-notices ol{margin:4px 0 0 20px;padding:0}.qt-notices li{margin:2px 0}.qt-extra-note{border:1px solid #111;border-top:0;padding:6px;font-size:13px}.qt-sign{display:flex;justify-content:flex-end;gap:10px;margin-top:7mm;font-size:14px}.qt-sign span{display:inline-block;min-width:68mm;text-align:center}.print-quote-template .print-toolbar{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans TC",Arial,sans-serif}@media(max-width:980px){.filter-grid{grid-template-columns:1fr}.quote-template-sheet{width:auto;min-height:auto}}@media print{.quote-template-sheet{box-shadow:none;margin:0;width:auto;min-height:auto;padding:6mm}.qt-title{margin-top:0}.qt-notices{font-size:11px}.qt-items td{height:21px}}

/* v5 Excel 報價單列印樣式：對齊使用者提供的 A:G 報價單版型 */
.excel-quote-sheet{width:210mm;min-height:297mm;padding:7mm 7mm 6mm 7mm;font-family:"PMingLiU","MingLiU","Noto Serif TC",serif;color:#000;background:#fff;box-shadow:0 8px 30px rgba(0,0,0,.12)}
.excel-company{text-align:center;line-height:1.25;margin:0 0 6mm 0}.excel-company-name{font-size:28px;font-weight:500;letter-spacing:1px}.excel-company-line{font-size:14px;margin-top:2px}.excel-title{text-align:center;font-size:18px;font-weight:600;letter-spacing:3px;margin:-3mm 0 3mm 0}.excel-quote-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:14px}.excel-quote-table .c-a{width:14mm}.excel-quote-table .c-b{width:31mm}.excel-quote-table .c-c{width:50mm}.excel-quote-table .c-d{width:24mm}.excel-quote-table .c-e{width:24mm}.excel-quote-table .c-f{width:25mm}.excel-quote-table .c-g{width:42mm}.excel-quote-table td,.excel-quote-table th{padding:3px 4px;vertical-align:middle;white-space:normal;background:#fff;color:#000}.excel-quote-table .meta-row td{border:0;height:7mm;font-size:15px}.excel-quote-table .meta-label{font-size:16px;white-space:nowrap}.excel-quote-table .header-row th{border:1px solid #000;height:7mm;text-align:left;font-weight:400}.excel-quote-table .header-row th:first-child{text-align:center}.excel-quote-table .item-row td{border-left:1px solid #000;border-right:1px solid #000;border-bottom:1px solid #000;height:8.3mm}.excel-quote-table .idx{text-align:center}.excel-quote-table .num{text-align:right}.excel-quote-table .total-row td{height:8mm;border:0}.excel-quote-table .total-row td:nth-child(5),.excel-quote-table .total-row td:nth-child(6){border:1px solid #000;font-size:16px;font-weight:700}.excel-quote-table .total-label{text-align:center}.excel-quote-table .spacer-row td{height:6mm;border:0}.excel-quote-table .notice-title-row td{border:0;font-size:15px;height:6mm}.excel-quote-table .notice-row td{border:0;font-size:14px;line-height:1.45;height:6.5mm;padding-top:2px;padding-bottom:2px}.excel-sign{display:flex;justify-content:flex-end;align-items:flex-end;font-size:16px;margin-top:7mm}.excel-sign span{display:inline-block;width:80mm;border-bottom:1px solid #000;height:9mm;margin-left:4px}@media print{.excel-quote-sheet{box-shadow:none;margin:0;width:auto;min-height:auto;padding:5mm 5mm}.excel-company-name{font-size:26px}.excel-quote-table{font-size:13px}.excel-quote-table .notice-row td{font-size:13px;height:auto}.excel-sign{margin-top:5mm}}

/* v6: CKEditor 與報價單版型修正 */
.ck-editor__editable{min-height:180px}.ck.ck-editor{max-width:100%}.form .ck-editor__editable p{margin:.4em 0}.print-body{background:#d9dde3}.excel-quote-sheet{width:210mm;min-height:297mm;padding:7mm 8mm 6mm 8mm;font-family:"PMingLiU","MingLiU","Noto Serif TC",serif;color:#000;background:#fff;box-shadow:0 8px 30px rgba(0,0,0,.12);box-sizing:border-box}.excel-company{text-align:center;line-height:1.22;margin:0 0 5mm 0}.excel-company-name{font-size:28px;font-weight:500;letter-spacing:1px}.excel-company-line{font-size:14px;margin-top:2px}.excel-title{text-align:center;font-size:18px;font-weight:700;letter-spacing:4px;margin:0 0 5mm 0}.excel-meta{font-size:15px;margin-bottom:2mm}.excel-meta-row{display:grid;align-items:center;min-height:8mm;column-gap:3mm}.excel-meta-row .m-label{white-space:nowrap}.excel-meta-row .m-value{min-height:7mm;display:flex;align-items:center;overflow:hidden}.excel-meta-row.row1{grid-template-columns:31mm 62mm 18mm 28mm 23mm 31mm}.excel-meta-row.row2{grid-template-columns:31mm 1fr}.excel-meta-row.row3{grid-template-columns:31mm 92mm 25mm 32mm}.excel-quote-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:14px;margin-top:1mm}.excel-quote-table .c-a{width:14mm}.excel-quote-table .c-b{width:19mm}.excel-quote-table .c-c{width:48mm}.excel-quote-table .c-d,.excel-quote-table .c-e,.excel-quote-table .c-f{width:24.5mm}.excel-quote-table .c-g{width:41.5mm}.excel-quote-table .c-bc{width:67mm}.excel-quote-table td,.excel-quote-table th{padding:3px 4px;vertical-align:middle;white-space:normal;background:#fff;color:#000;border:1px solid #000}.excel-quote-table .header-row th{height:7mm;text-align:left;font-weight:400}.excel-quote-table .header-row th:first-child{text-align:center}.excel-quote-table .item-row td{height:8.1mm}.excel-quote-table .idx{text-align:center}.excel-quote-table .name{word-break:break-word}.excel-quote-table .num{text-align:right}.excel-quote-table .total-row td{height:8mm;font-weight:700}.excel-quote-table.customer-mode .total-row td:first-child,.excel-quote-table.customer-mode .total-row td:nth-child(2),.excel-quote-table.customer-mode .total-row td:nth-child(3),.excel-quote-table.customer-mode .total-row td:nth-child(4),.excel-quote-table.customer-mode .total-row td:nth-child(7){border:0}.excel-quote-table .total-label{text-align:center}.excel-quote-table .spacer-row td{height:6mm;border:0}.excel-quote-table .notice-title-row td{border:0;font-size:15px;height:6mm}.excel-quote-table .notice-html-row td{border:0;font-size:13.5px;line-height:1.45;padding-top:2px}.excel-quote-table .notice-html-row p{margin:2px 0}.excel-quote-table .notice-html-row ol,.excel-quote-table .notice-html-row ul{margin:2px 0 2px 20px;padding:0}.excel-sign{display:flex;justify-content:flex-end;align-items:flex-end;font-size:16px;margin-top:7mm}.excel-sign span{display:inline-block;width:80mm;border-bottom:1px solid #000;height:9mm;margin-left:4px}.cost-summary-row td{font-weight:700;background:#fff}.print-toolbar{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans TC",Arial,sans-serif}@media print{.excel-quote-sheet{box-shadow:none;margin:0;width:auto;min-height:auto;padding:5mm 5mm}.excel-company-name{font-size:26px}.excel-meta{font-size:14px}.excel-quote-table{font-size:13px}.excel-quote-table .notice-html-row td{font-size:12.5px}.excel-sign{margin-top:5mm}@page{size:A4;margin:5mm}}

/* v7: 報價單 Excel 樣式精修，LOGO 在左、公司資料在右，符合使用者提供截圖 */
.grid .span-2{grid-column:1 / -1}
.ly-quote-sheet{padding:0 0 6mm 0;font-family:"PMingLiU","MingLiU","Noto Serif TC",serif}
.ly-quote-head{width:100%;border-collapse:collapse;table-layout:fixed;margin:0 0 0 0;font-family:"PMingLiU","MingLiU","Noto Serif TC",serif;color:#000}
.ly-quote-head td{border:1px solid #d7d7d7;padding:2px 5px;vertical-align:middle;background:#fff}
.ly-logo-cell{width:42mm;text-align:center;vertical-align:middle;height:28mm}
.ly-logo{max-width:37mm;max-height:27mm;object-fit:contain}
.ly-company-name{font-size:26px;letter-spacing:5px;text-align:center;height:10mm;font-weight:500;line-height:1.05}
.ly-company-line{text-align:center;font-size:15px;height:7mm;line-height:1.1;letter-spacing:1px}
.ly-doc-title{text-align:center;font-size:19px;font-weight:700;height:9mm;letter-spacing:5px;line-height:1.1}
.ly-meta-row td{height:8.5mm;font-size:15px;line-height:1.1}
.ly-meta-label{font-weight:700;white-space:nowrap;letter-spacing:1px}
.ly-meta-label.spaced{letter-spacing:5px}
.ly-quote-items{margin-top:0}
.ly-quote-items th{font-weight:400;text-align:left;height:7.5mm}
.ly-quote-items th:first-child{text-align:center}.ly-quote-items td{height:8mm}.internal-note{font-size:13px;margin:8mm 7mm 0;text-align:left}.pdf-sign-note{font-size:12px;color:#444}
@media print{.ly-quote-sheet{padding:0}.ly-company-name{font-size:25px}.ly-company-line{font-size:14px}.ly-doc-title{font-size:18px}.ly-meta-row td{font-size:14px}}

/* v8: 報價單表頭精修：資料全部由 company_profile/settings 與客戶/報價單資料帶入，不寫死 */
.ly-quote-sheet{padding:0 0 6mm 0;font-family:"DFKai-SB","BiauKai","標楷體","PMingLiU","MingLiU","Noto Serif TC",serif;color:#000}
.ly-quote-top{position:relative;height:34mm;border-top:1px solid #d7d7d7;border-bottom:1px solid #d7d7d7;background:repeating-linear-gradient(to bottom,#fff 0,#fff 10.9mm,#d7d7d7 11mm);overflow:hidden}
.ly-quote-top .ly-logo{position:absolute;left:40mm;top:2mm;width:32mm;max-width:32mm;height:28mm;max-height:28mm;object-fit:contain}
.ly-company-block{position:absolute;left:70mm;right:8mm;top:0;text-align:left;line-height:1.1;color:#000}
.ly-company-name{font-family:"DFKai-SB","BiauKai","標楷體","PMingLiU","MingLiU","Noto Serif TC",serif;font-size:28px;letter-spacing:5px;text-align:left;height:11mm;line-height:11mm;font-weight:400;white-space:nowrap}
.ly-company-line{font-family:"DFKai-SB","BiauKai","標楷體","PMingLiU","MingLiU","Noto Serif TC",serif;text-align:left;font-size:18px;height:11mm;line-height:11mm;letter-spacing:1px;white-space:nowrap}
.ly-doc-title{font-family:"DFKai-SB","BiauKai","標楷體","PMingLiU","MingLiU","Noto Serif TC",serif;text-align:center;font-size:21px;font-weight:700;height:11mm;line-height:11mm;letter-spacing:5px;border-bottom:1px solid #d7d7d7;color:#000}
.ly-quote-head{width:100%;border-collapse:collapse;table-layout:fixed;margin:0;font-family:"DFKai-SB","BiauKai","標楷體","PMingLiU","MingLiU","Noto Serif TC",serif;color:#000}
.ly-quote-head td{border:1px solid #d7d7d7;padding:0 5px;vertical-align:middle;background:#fff;height:11mm;font-size:18px;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:clip}
.ly-quote-head td:first-child{width:36mm}.ly-quote-head td:nth-child(4){width:25mm}.ly-quote-head td:nth-child(6){width:30mm}.ly-meta-label{font-weight:700;letter-spacing:1px}.ly-meta-label.center{text-align:center}.ly-meta-label.spaced{letter-spacing:8px;text-align:left}
.ly-quote-items{margin-top:0}.ly-quote-items th{font-family:"DFKai-SB","BiauKai","標楷體","PMingLiU","MingLiU","Noto Serif TC",serif;font-size:17px;font-weight:400;height:8mm}.ly-quote-items td{font-size:15px;height:8.5mm}
@media print{.ly-quote-top{height:34mm}.ly-quote-top .ly-logo{left:40mm;top:2mm;width:32mm;height:28mm}.ly-company-block{left:70mm}.ly-company-name{font-size:26px}.ly-company-line{font-size:17px}.ly-doc-title{font-size:20px}.ly-quote-head td{font-size:17px}}

/* v9: 報價單版型依使用者 PDF 樣式重新切齊；公司資料從 settings/company_profile 讀取，不寫死。 */
.print-quote-template{margin:0;background:#d9dde3;}
.print-quote-template .print-toolbar{position:sticky;top:0;z-index:10;background:#fff;padding:8px;border-bottom:1px solid #ddd;}
.print-quote-template .ly-quote-sheet{
  width:210mm;
  height:297mm;
  min-height:0;
  margin:0 auto;
  padding:5mm 5mm 5mm 5mm;
  box-sizing:border-box;
  background:#fff;
  color:#000;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  font-family:"DFKai-SB","BiauKai","標楷體","PMingLiU","MingLiU",serif;
  box-shadow:0 8px 30px rgba(0,0,0,.12);
}
.print-quote-template .ly-main-header,
.print-quote-template .ly-customer-head,
.print-quote-template .ly-quote-items{width:100%;border-collapse:collapse;table-layout:fixed;margin:0;}
.print-quote-template .ly-main-header td{border:1px solid #d7d7d7;background:#fff;padding:0;vertical-align:middle;}
.print-quote-template .ly-logo-box{width:42mm;text-align:right;padding-right:4mm!important;}
.print-quote-template .ly-logo-img{width:35mm;max-width:35mm;height:25mm;max-height:25mm;object-fit:contain;display:inline-block;}
.print-quote-template .ly-company-name-cell{height:10mm;font-size:27px;line-height:10mm;font-weight:400;letter-spacing:5px;text-align:left;padding-left:4mm!important;white-space:nowrap;}
.print-quote-template .ly-company-line-cell{height:7.5mm;font-size:18px;line-height:7.5mm;text-align:left;padding-left:4mm!important;letter-spacing:1px;white-space:nowrap;}
.print-quote-template .ly-doc-title-cell{height:9mm;font-size:23px;line-height:9mm;font-weight:700;text-align:center;letter-spacing:5px;}
.print-quote-template .ly-customer-head td{border:1px solid #d7d7d7;background:#fff;height:9.4mm;padding:0 3px;vertical-align:middle;font-size:19px;line-height:1.05;white-space:nowrap;overflow:hidden;text-overflow:clip;}
.print-quote-template .ly-customer-head .ly-m1{width:36mm}.print-quote-template .ly-customer-head .ly-m2{width:58mm}.print-quote-template .ly-customer-head .ly-m3{width:28mm}.print-quote-template .ly-customer-head .ly-m4{width:24mm}.print-quote-template .ly-customer-head .ly-m5{width:28mm}.print-quote-template .ly-customer-head .ly-m6{width:auto}
.print-quote-template .ly-meta-label{font-weight:700;letter-spacing:1px;}
.print-quote-template .ly-meta-label.center{text-align:center;}
.print-quote-template .ly-meta-label.spaced{letter-spacing:8px;}
.print-quote-template .ly-quote-items{margin-top:0;border:2px solid #000;}
.print-quote-template .ly-quote-items td,
.print-quote-template .ly-quote-items th{border:1px solid #000;background:#fff;color:#000;padding:0 3px;vertical-align:middle;font-family:"DFKai-SB","BiauKai","標楷體","PMingLiU","MingLiU",serif;}
.print-quote-template .ly-quote-items th{height:8mm;font-size:17px;font-weight:400;text-align:left;line-height:1;}
.print-quote-template .ly-quote-items th:first-child{text-align:center;}
.print-quote-template .ly-quote-items .item-row td{height:8.2mm;font-size:15px;line-height:1.1;}
.print-quote-template .ly-quote-items .idx{text-align:center;}
.print-quote-template .ly-quote-items .num{text-align:right;}
.print-quote-template .ly-quote-items .name{word-break:break-word;}
.print-quote-template .ly-quote-items .total-row td{height:8mm;font-size:16px;font-weight:700;}
.print-quote-template .ly-quote-items.customer-mode .total-row td:first-child,
.print-quote-template .ly-quote-items.customer-mode .total-row td:nth-child(2),
.print-quote-template .ly-quote-items.customer-mode .total-row td:nth-child(3),
.print-quote-template .ly-quote-items.customer-mode .total-row td:nth-child(4),
.print-quote-template .ly-quote-items.customer-mode .total-row td:nth-child(7){border:0;background:#fff;}
.print-quote-template .ly-notice-block{font-size:14px;line-height:1.25;margin-top:5mm;max-height:59mm;overflow:hidden;}
.print-quote-template .ly-notice-title{font-weight:700;margin-bottom:1mm;}
.print-quote-template .ly-notice-content p{margin:1px 0;}
.print-quote-template .ly-notice-content ol,.print-quote-template .ly-notice-content ul{margin:1px 0 1px 20px;padding:0;}
.print-quote-template .excel-sign{margin-top:auto;font-size:19px;text-align:right;display:block;}
.print-quote-template .excel-sign span{display:inline-block;width:80mm;height:8mm;border-bottom:1px solid #000;margin-left:3mm;}
.print-quote-template .internal-note{font-size:14px;margin-top:6mm;}
@media print{
  body.print-quote-template{background:#fff;margin:0;}
  .print-quote-template .print-toolbar{display:none;}
  .print-quote-template .ly-quote-sheet{box-shadow:none;margin:0;width:210mm;height:297mm;padding:5mm;page-break-after:avoid;}
  @page{size:A4;margin:0;}
}

/* v10: 報價單一頁版型精修：表頭公司資料/LOGO 整組置中、報價日期不截斷、空白列不帶 0、最後一項後顯示「以下空白」。 */
.print-quote-template .ly-main-header td{border:1px solid #d7d7d7;background:#fff;padding:0;vertical-align:middle;}
.print-quote-template .ly-company-wrap-cell{height:28mm;text-align:center;}
.print-quote-template .ly-company-wrap{display:inline-flex;align-items:center;justify-content:center;gap:5mm;height:28mm;max-width:135mm;margin:0 auto;}
.print-quote-template .ly-logo-img{width:34mm;max-width:34mm;height:25mm;max-height:25mm;object-fit:contain;display:block;}
.print-quote-template .ly-company-text{text-align:left;white-space:nowrap;}
.print-quote-template .ly-company-name-cell{height:9.5mm;font-size:26px;line-height:9.5mm;font-weight:400;letter-spacing:5px;text-align:left;padding:0!important;white-space:nowrap;}
.print-quote-template .ly-company-line-cell{height:7.5mm;font-size:17px;line-height:7.5mm;text-align:left;padding:0!important;letter-spacing:1px;white-space:nowrap;}
.print-quote-template .ly-doc-title-cell{height:9mm;font-size:23px;line-height:9mm;font-weight:700;text-align:center;letter-spacing:5px;}
.print-quote-template .ly-customer-head .ly-m1{width:35mm}
.print-quote-template .ly-customer-head .ly-m2{width:56mm}
.print-quote-template .ly-customer-head .ly-m3{width:24mm}
.print-quote-template .ly-customer-head .ly-m4{width:22mm}
.print-quote-template .ly-customer-head .ly-m5{width:27mm}
.print-quote-template .ly-customer-head .ly-m6{width:36mm}
.print-quote-template .ly-customer-head td{font-size:17px;padding:0 2px;}
.print-quote-template .ly-customer-head .ly-date-cell{font-size:16px;letter-spacing:0;}
.print-quote-template .ly-quote-items .blank-note-row .name{text-align:left;font-weight:400;letter-spacing:1px;color:#000;}
@media print{
  .print-quote-template .ly-company-wrap-cell{height:28mm;}
  .print-quote-template .ly-company-name-cell{font-size:25px;}
  .print-quote-template .ly-company-line-cell{font-size:16px;}
  .print-quote-template .ly-customer-head td{font-size:16px;}
  .print-quote-template .ly-customer-head .ly-date-cell{font-size:15px;}
}

/* v11: 報價單微調、日期搜尋預設、地址郵遞區號提示 */
.field-hint{font-size:12px;color:#6b7280;margin-top:4px;}
.print-quote-template .ly-company-address{transform:translateX(-4em);}
@media print{.print-quote-template .ly-company-address{transform:translateX(-4em);}}


/* v12: 報價單表頭微調與 ERP 兩大區塊導覽 */
.print-quote-template .ly-company-address{transform:translateX(-2em);}
.print-quote-template .ly-company-name-cell{font-size:30px;line-height:10.5mm;height:10.5mm;}
.print-quote-template .ly-company-phone{letter-spacing:0;}
@media print{
  .print-quote-template .ly-company-address{transform:translateX(-2em);}
  .print-quote-template .ly-company-name-cell{font-size:28px;line-height:10mm;height:10mm;}
}
.erp-major-title{margin:16px 10px 6px;padding:8px 10px;border-radius:10px;background:#1f2937;color:#fff;font-weight:800;letter-spacing:2px;text-align:center;box-shadow:inset 0 0 0 1px rgba(255,255,255,.08);}
.menu-subgroup{margin:10px 12px 4px;color:#93c5fd;font-size:12px;font-weight:700;letter-spacing:1px;}
.erp-module-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-bottom:18px;}
.erp-module-card{border:1px solid #d1d5db;border-radius:16px;background:#fff;padding:22px;box-shadow:0 8px 22px rgba(15,23,42,.08);}
.erp-module-card h2{margin:0 0 8px;font-size:28px;letter-spacing:2px;}
.erp-module-card p{margin:0 0 14px;color:#374151;line-height:1.6;}
.erp-module-card.erp-inventory-card{border-left:8px solid #1d4ed8;}
.erp-module-card.erp-accounting-card{border-left:8px solid #7c3aed;}
.erp-module-actions{display:flex;gap:8px;flex-wrap:wrap;}
@media (max-width:900px){.erp-module-grid{grid-template-columns:1fr;}}

/* v13: 側邊欄穩定、共用設定獨立、報價單表頭與金額格式微調 */
/* v91.4: 側邊欄不再先隱藏，避免換頁時左側短暫白屏閃爍。 */
.sidebar{visibility:visible;}
.sidebar.sidebar-ready{visibility:visible;}
.erp-major-總覽{background:#475569;}
.erp-major-共用設定{background:#334155;}
.erp-major-工作管理{background:#0f766e;}
.erp-major-進銷存{background:#1d4ed8;}
.erp-major-會計{background:#7c3aed;}
.erp-common-card{border-left:8px solid #334155;}
.erp-work-card{border-left:8px solid #0f766e;}
.erp-major-合約管理{background:#1f2937;}
.erp-contract-card{border-left:8px solid #1f2937;}
.erp-internal-procurement-card{border-left:8px solid #7c3aed;}
.erp-module-grid-three{grid-template-columns:repeat(3,minmax(0,1fr));}
@media (max-width:1100px){.erp-module-grid-three{grid-template-columns:1fr;}}
.print-quote-template .ly-company-name-cell{transform:translateX(-1em);}
.print-quote-template .ly-company-phone{transform:translateX(-1em);white-space:pre;letter-spacing:0;}
.print-quote-template .ly-company-address{transform:translateX(-2em);}
.print-quote-template .ly-label-cell{padding-left:3px!important;padding-right:3px!important;overflow:visible!important;text-overflow:clip!important;}
.print-quote-template .ly-label-fill{display:flex;width:100%;justify-content:space-between;align-items:center;letter-spacing:0;white-space:nowrap;}
.print-quote-template .ly-customer-head .ly-m1{width:36mm;}
.print-quote-template .ly-customer-head td{overflow:visible;text-overflow:clip;}
@media print{
  .sidebar{visibility:visible;}
  .print-quote-template .ly-company-name-cell{transform:translateX(-1em);}
  .print-quote-template .ly-company-phone{transform:translateX(-1em);white-space:pre;letter-spacing:0;}
  .print-quote-template .ly-company-address{transform:translateX(-2em);}
}

/* v14: 報價單表頭、客戶資料區、CKEditor 與注意事項微調 */
.print-quote-template .ly-company-phone{transform:translateX(-2em);white-space:pre;letter-spacing:0;}
.print-quote-template .ly-customer-head td{border:0!important;background:#fff;}
.print-quote-template .ly-customer-head{border-collapse:collapse;}
.print-quote-template .ly-notice-block{font-size:13.5px;line-height:1.34;margin-top:5mm;max-height:64mm;overflow:hidden;}
.print-quote-template .ly-notice-title{margin-bottom:1.5mm;}
.print-quote-template .ly-notice-content p{margin:2px 0;line-height:1.34;}
.print-quote-template .ly-notice-content ol,.print-quote-template .ly-notice-content ul{margin:2px 0 2px 20px;padding:0;}
.print-quote-template .ly-notice-content li{margin:2px 0;line-height:1.34;}
.ck.ck-toolbar .ck-button.ck-color-grid__tile{min-width:auto;}
@media print{
  .print-quote-template .ly-company-phone{transform:translateX(-2em);white-space:pre;letter-spacing:0;}
  .print-quote-template .ly-customer-head td{border:0!important;background:#fff;}
  .print-quote-template .ly-notice-block{font-size:13px;line-height:1.32;max-height:62mm;}
  .print-quote-template .ly-notice-content p,.print-quote-template .ly-notice-content li{margin:1.7px 0;line-height:1.32;}
}

/* v15: 報價單表頭去除公司資料虛框、12 條注意事項一頁最佳化、維護案報價單版型 */
.print-quote-template .ly-main-header td{border:0!important;background:#fff!important;}
.print-quote-template .ly-company-wrap-cell{border:0!important;}
.print-quote-template .ly-doc-title-cell{border:0!important;}
.print-quote-template .ly-quote-items .item-row td{height:7.75mm;font-size:14.5px;line-height:1.06;}
.print-quote-template .ly-notice-block{font-size:12.7px;line-height:1.26;margin-top:4mm;max-height:70mm;overflow:visible;}
.print-quote-template .ly-notice-title{margin-bottom:1mm;}
.print-quote-template .ly-notice-content p{margin:1.2px 0;line-height:1.26;}
.print-quote-template .ly-notice-content ol,.print-quote-template .ly-notice-content ul{margin:1px 0 1px 18px;padding:0;}
.print-quote-template .ly-notice-content li{margin:1.2px 0;line-height:1.26;}
.print-quote-template .ly-maintenance-items .item-row td{height:7.4mm;font-size:14px;line-height:1.08;}
.print-quote-template .ly-maintenance-items .span-row td.name{white-space:normal;word-break:break-word;}
.print-quote-template .ly-maintenance-items .red-row td{color:#d00;}
.print-quote-template .ly-maintenance-items .emphasis-row td{height:10mm;line-height:1.22;}
.print-quote-template .ly-maintenance-items .total-row td{height:8mm;}
@media print{
  .print-quote-template .ly-main-header td{border:0!important;background:#fff!important;}
  .print-quote-template .ly-quote-items .item-row td{height:7.55mm;font-size:14px;line-height:1.05;}
  .print-quote-template .ly-notice-block{font-size:12.2px;line-height:1.22;margin-top:3.5mm;max-height:70mm;overflow:visible;}
  .print-quote-template .ly-notice-content p,.print-quote-template .ly-notice-content li{margin:1px 0;line-height:1.22;}
  .print-quote-template .ly-maintenance-items .item-row td{height:7.25mm;font-size:13.5px;}
  .print-quote-template .ly-maintenance-items .emphasis-row td{height:9.6mm;}
}

/* v16: CKEditor fallback、注意事項字級/行距、客戶資料標籤切齊、維護案專屬欄位 */
.aspa-editor{border:1px solid #cbd5e1;border-radius:8px;background:#fff;overflow:hidden;}
.aspa-editor-toolbar{display:flex;gap:4px;align-items:center;flex-wrap:wrap;padding:6px;background:#f8fafc;border-bottom:1px solid #e2e8f0;}
.aspa-editor-toolbar button{border:1px solid #cbd5e1;background:#fff;border-radius:5px;padding:4px 8px;cursor:pointer;font-size:13px;}
.aspa-editor-toolbar input[type="color"]{width:34px;height:28px;border:1px solid #cbd5e1;border-radius:5px;background:#fff;padding:2px;}
.aspa-editor-body{min-height:130px;padding:10px;line-height:1.55;outline:none;}
.form .span-2{grid-column:1 / -1;}
.form-control.readonly{background:#f8fafc;color:#475569;}
.print-quote-template .ly-company-phone{transform:translateX(-2.6em);white-space:pre;letter-spacing:0;}
.print-quote-template .ly-label-fill{display:flex;width:100%;justify-content:space-between;align-items:center;letter-spacing:0;white-space:nowrap;}
.print-quote-template .ly-customer-head .ly-m1{width:36mm;}
.print-quote-template .ly-notice-block{font-size:13.6px;line-height:1.34;margin-top:4mm;max-height:73mm;overflow:visible;}
.print-quote-template .ly-notice-title{font-size:13.8px;margin-bottom:1.3mm;}
.print-quote-template .ly-notice-content p{margin:1.7px 0;line-height:1.34;}
.print-quote-template .ly-notice-content ol,.print-quote-template .ly-notice-content ul{margin:1.7px 0 1.7px 18px;padding:0;}
.print-quote-template .ly-notice-content li{margin:1.7px 0;line-height:1.34;}
.print-quote-template .ly-maintenance-items .rich-cell p,
.print-quote-template .ly-maintenance-items .name p{display:inline;margin:0;}
@media print{
  .print-quote-template .ly-company-phone{transform:translateX(-2.6em);white-space:pre;letter-spacing:0;}
  .print-quote-template .ly-notice-block{font-size:13.1px;line-height:1.30;margin-top:3.5mm;max-height:72mm;overflow:visible;}
  .print-quote-template .ly-notice-title{font-size:13.3px;margin-bottom:1.1mm;}
  .print-quote-template .ly-notice-content p,.print-quote-template .ly-notice-content li{margin:1.4px 0;line-height:1.30;}
}

/* v17: 本機富文字編輯器修正、客戶資料欄位左右分開且冒號固定 */
.aspa-editor-source{display:none!important;}
.aspa-editor{border:1px solid #94a3b8;border-radius:8px;background:#fff;overflow:hidden;margin-top:4px;}
.aspa-editor-toolbar{display:flex;gap:6px;align-items:center;flex-wrap:wrap;padding:7px;background:#f1f5f9;border-bottom:1px solid #cbd5e1;}
.aspa-editor-toolbar button{border:1px solid #94a3b8;background:#fff;border-radius:5px;padding:4px 9px;cursor:pointer;font-size:13px;line-height:1.2;}
.aspa-editor-toolbar button:hover{background:#e2e8f0;}
.aspa-editor-toolbar .aspa-color-tool{display:inline-flex;align-items:center;gap:4px;margin:0;font-weight:600;font-size:13px;color:#334155;}
.aspa-editor-toolbar input[type="color"]{width:36px;height:28px;border:1px solid #94a3b8;border-radius:5px;background:#fff;padding:2px;cursor:pointer;}
.aspa-editor-body{min-height:150px;padding:10px 12px;line-height:1.6;outline:none;cursor:text;background:#fff;color:#111827;white-space:normal;overflow:auto;user-select:text;-webkit-user-select:text;}
.aspa-editor-body:focus{box-shadow:inset 0 0 0 2px rgba(37,99,235,.22);}
.aspa-editor-body p{margin:.35em 0;}
.aspa-editor-body ol,.aspa-editor-body ul{margin:.35em 0 .35em 1.4em;padding:0;}
.print-quote-template .ly-label-cell{padding-left:2px!important;padding-right:2px!important;}
.print-quote-template .ly-label-mini{width:100%;border-collapse:collapse!important;table-layout:fixed!important;margin:0!important;background:#fff!important;}
.print-quote-template .ly-label-mini td{border:0!important;background:#fff!important;padding:0!important;height:auto!important;line-height:1!important;font-size:inherit!important;font-weight:700!important;vertical-align:middle!important;white-space:nowrap!important;}
.print-quote-template .ly-label-mini .ly-label-word{text-align:left!important;letter-spacing:1px!important;}
.print-quote-template .ly-label-mini .ly-label-colon{width:4mm!important;text-align:right!important;}
.print-quote-template .ly-meta-value{padding-left:5mm!important;text-align:left!important;}
.print-quote-template .ly-address-value,
.print-quote-template .ly-phone-value{padding-left:5mm!important;}
@media print{
  .print-quote-template .ly-label-cell{padding-left:2px!important;padding-right:2px!important;}
  .print-quote-template .ly-meta-value{padding-left:4mm!important;text-align:left!important;}
  .print-quote-template .ly-address-value,
  .print-quote-template .ly-phone-value{padding-left:4mm!important;}
}

/* v18: 客戶資料標籤採 Word 式左右分散對齊，冒號固定 */
.print-quote-template .ly-label-mini{width:100%;border-collapse:collapse!important;table-layout:fixed!important;margin:0!important;background:#fff!important;}
.print-quote-template .ly-label-mini td{border:0!important;background:#fff!important;padding:0!important;height:auto!important;line-height:1!important;font-size:inherit!important;font-weight:700!important;vertical-align:middle!important;white-space:nowrap!important;}
.print-quote-template .ly-label-mini .ly-label-word{width:auto!important;text-align:left!important;letter-spacing:0!important;}
.print-quote-template .ly-label-mini .ly-label-colon{width:4mm!important;text-align:right!important;padding-left:0!important;}
.print-quote-template .ly-label-distribute{display:flex;width:100%;justify-content:space-between;align-items:center;letter-spacing:0!important;}
.print-quote-template .ly-label-distribute span{display:inline-block;line-height:1;}
.print-quote-template .ly-address-value,
.print-quote-template .ly-phone-value{padding-left:6mm!important;text-align:left!important;}
@media print{
  .print-quote-template .ly-address-value,
  .print-quote-template .ly-phone-value{padding-left:5mm!important;text-align:left!important;}
}

/* v19: 報價單上方公司聯絡電話往右約 2 格，LOGO 與其他公司資料不動 */
.print-quote-template .ly-company-phone{transform:translateX(-0.6em);white-space:pre;letter-spacing:0;}
@media print{
  .print-quote-template .ly-company-phone{transform:translateX(-0.6em);white-space:pre;letter-spacing:0;}
}

/* v20: v19 往右 2 格太多，電話位置往左回 1 格 */
.print-quote-template .ly-company-phone{transform:translateX(-1.6em);white-space:pre;letter-spacing:0;}
@media print{
  .print-quote-template .ly-company-phone{transform:translateX(-1.6em);white-space:pre;letter-spacing:0;}
}

/* v23: 進貨單 / 銷貨單三聯式、二聯式列印版型 - 對齊附件樣式並避免預覽超出 */
.print-slip{background:#e5e7eb;overflow-x:hidden;}
.ly-slip-sheet{width:280mm;max-width:calc(100vw - 48px);min-height:190mm;padding:7mm 8mm 6mm 8mm;box-sizing:border-box;font-family:"PMingLiU","MingLiU","Noto Serif TC",serif;color:#000;background:#fff;box-shadow:0 8px 30px rgba(0,0,0,.12);overflow:hidden;}
.slip-top{display:grid;grid-template-columns:1fr 1fr;align-items:start;margin-bottom:0;}
.slip-company{font-size:19px;line-height:1.35;}
.slip-company-name{font-size:27px;font-weight:700;line-height:1.2;margin-bottom:2mm;}
.slip-title-wrap{text-align:center;padding-top:2mm;}
.slip-title{font-size:40px;font-weight:700;letter-spacing:18px;line-height:1.1;}
.slip-page{font-size:21px;margin-top:2mm;}
.slip-fax{text-align:center;font-size:19px;margin:-7mm 0 1.5mm 0;}
.slip-meta,.slip-items,.slip-totals{width:100%;border-collapse:collapse;table-layout:fixed;font-size:20px;line-height:1.12;}
.slip-meta{border:1px solid #000;border-bottom:0;}
.slip-meta td{border:0;padding:1.5mm 1.6mm;white-space:nowrap;vertical-align:middle;background:#fff;overflow:visible;text-overflow:clip;}
.slip-meta .m-1{width:38%;}.slip-meta .m-2{width:28%;}.slip-meta .m-3{width:34%;}
.slip-meta-label{display:inline-block;min-width:24mm;text-align:justify;text-align-last:justify;white-space:nowrap;}
.slip-meta-value{display:inline-block;padding-left:1mm;vertical-align:baseline;white-space:nowrap;overflow:visible;text-overflow:clip;}
.slip-address-value{max-width:none;overflow:visible;text-overflow:clip;}
.slip-items th,.slip-items td{border:1px solid #000;padding:1.6mm 1.6mm;height:8.4mm;background:#fff;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.slip-items th{font-weight:400;text-align:center;}
.slip-items .c-idx{width:4%;}.slip-items .c-sku{width:15%;}.slip-items .c-name{width:34%;}.slip-items .c-qty{width:10%;}.slip-items .c-unit{width:7%;}.slip-items .c-price{width:11%;}.slip-items .c-amount{width:13%;}.slip-items .c-note{width:6%;}
.slip-items .c{text-align:center;}.slip-items .r{text-align:right;}
.slip-totals{border-left:1px solid #000;border-right:1px solid #000;border-bottom:1px solid #000;}
.slip-totals th,.slip-totals td{border:0;padding:1.8mm 2.5mm;height:8mm;background:#fff;font-weight:400;white-space:nowrap;}
.slip-totals th{text-align:left;}.slip-totals td{text-align:right;}
.slip-note{border-left:1px solid #000;border-right:1px solid #000;border-bottom:1px solid #000;min-height:9mm;padding:2mm;font-size:20px;}
.slip-fixed-sign{display:grid;grid-template-columns:repeat(5,1fr);gap:10mm;font-size:20px;padding:2.5mm 4mm 0 4mm;}
@media screen and (max-width:1180px){
  .ly-slip-sheet{padding:6mm 6mm 5mm 6mm;}
  .slip-company{font-size:17px}.slip-company-name{font-size:24px}.slip-title{font-size:34px;letter-spacing:12px}.slip-page{font-size:18px}.slip-fax{font-size:17px;}
  .slip-meta,.slip-items,.slip-totals{font-size:17px;}
  .slip-meta-label{min-width:25mm;}
  .slip-items th,.slip-items td{padding:1.2mm 1.2mm;height:7.6mm;}
  .slip-note,.slip-fixed-sign{font-size:17px;}
}
@media print{
  @page{size:landscape;margin:5mm;}
  html,body{width:100%;height:auto;}
  .print-slip{overflow:visible;background:#fff;}
  .ly-slip-sheet{box-shadow:none;margin:0 auto;width:270mm;max-width:100%;min-height:0;padding:0;font-size:18px;overflow:visible;}
  .slip-company{font-size:16px;line-height:1.22}.slip-company-name{font-size:24px}.slip-title{font-size:34px;letter-spacing:16px}.slip-page{font-size:17px}.slip-fax{font-size:16px;margin:-6mm 0 1mm 0;}
  .slip-meta,.slip-items,.slip-totals{font-size:17px;line-height:1.05;}
  .slip-meta-label{min-width:22mm;}
  .slip-meta td{padding:1.2mm 1.3mm;overflow:visible;text-overflow:clip;}
  .slip-items th,.slip-items td{height:6.8mm;padding:.8mm 1mm;}
  .slip-totals th,.slip-totals td{height:6.5mm;padding:1.1mm 1.6mm;}
  .slip-note{min-height:7mm;padding:1.2mm 1.6mm;}
  .slip-note,.slip-fixed-sign{font-size:17px;}
  .slip-fixed-sign{padding:1.8mm 4mm 0 4mm;}
}


/* v27 rich editor color fix */
.aspa-editor-toolbar .aspa-apply-color-btn{font-weight:600;}
.aspa-editor-toolbar .aspa-color-swatches{display:inline-flex;gap:3px;align-items:center;margin-right:4px;}
.aspa-editor-toolbar .aspa-color-swatch{width:22px;height:22px;min-width:22px;border:1px solid #64748b;border-radius:4px;padding:0;cursor:pointer;}
.aspa-editor-toolbar .aspa-color-swatch:hover{outline:2px solid rgba(37,99,235,.25);}

/* v30: 富文字注意事項換行修正：保留 div 行距與紅字樣式，不讓注意事項擠成一行 */
.print-quote-template .ly-notice-content div{
  display:block;
  margin:1.6px 0;
  line-height:1.32;
}
.print-quote-template .ly-notice-content span[style]{
  display:inline;
}
@media print{
  .print-quote-template .ly-notice-content div{
    margin:1.3px 0;
    line-height:1.28;
  }
}

/* v34: 報價單列印一頁化與 PDF 輸出一致性修正 */
@media print{
  .print-quote-template .ly-quote-sheet{height:297mm;max-height:297mm;overflow:hidden;padding:4.5mm 5mm 4.5mm 5mm;}
  .print-quote-template .ly-company-wrap-cell{height:26mm!important;}
  .print-quote-template .ly-company-wrap{height:26mm!important;}
  .print-quote-template .ly-doc-title-cell{height:8mm!important;font-size:21px!important;line-height:8mm!important;}
  .print-quote-template .ly-customer-head td{height:8.2mm!important;font-size:15.5px!important;}
  .print-quote-template .ly-quote-items th{height:7.2mm!important;font-size:15.5px!important;}
  .print-quote-template .ly-quote-items .item-row td{height:6.85mm!important;font-size:13.2px!important;line-height:1.02!important;}
  .print-quote-template .ly-quote-items .total-row td{height:7mm!important;font-size:14px!important;}
  .print-quote-template .ly-notice-block{font-size:11.3px!important;line-height:1.18!important;margin-top:2.6mm!important;max-height:50mm!important;overflow:hidden!important;break-inside:avoid;page-break-inside:avoid;}
  .print-quote-template .ly-notice-title{font-size:11.5px!important;margin-bottom:.6mm!important;}
  .print-quote-template .ly-notice-content p,.print-quote-template .ly-notice-content li{margin:.6px 0!important;line-height:1.18!important;}
  .print-quote-template .ly-notice-content ol,.print-quote-template .ly-notice-content ul{margin:.6px 0 .6px 15px!important;padding:0!important;}
  .print-quote-template .excel-sign{font-size:16px!important;margin-top:auto!important;page-break-inside:avoid;break-inside:avoid;}
  .print-quote-template .excel-sign span{height:5mm!important;}
}

/* v35: 報價單手動列印/另存 PDF 一頁化修正
   - 預覽正常時，瀏覽器「列印成 PDF」也不可被切成 2 頁。
   - 縮短固定 15 列高度與注意事項區塊，但維持可讀性。
*/
@media print{
  @page{size:A4 portrait;margin:4mm;}
  .print-quote-template .ly-quote-sheet{
    width:202mm!important;
    height:289mm!important;
    max-height:289mm!important;
    min-height:0!important;
    overflow:hidden!important;
    padding:3.5mm 4mm 3.5mm 4mm!important;
    box-sizing:border-box!important;
  }
  .print-quote-template .ly-company-wrap-cell{height:23.5mm!important;}
  .print-quote-template .ly-company-wrap{height:23.5mm!important;}
  .print-quote-template .ly-logo-img{max-height:21mm!important;max-width:30mm!important;}
  .print-quote-template .ly-company-name-cell{font-size:24px!important;line-height:7.2mm!important;}
  .print-quote-template .ly-company-line-cell{font-size:13.2px!important;line-height:5.6mm!important;}
  .print-quote-template .ly-doc-title-cell{height:6.8mm!important;font-size:19px!important;line-height:6.8mm!important;}
  .print-quote-template .ly-customer-head td{height:7.1mm!important;font-size:14.3px!important;line-height:1.05!important;padding-top:0!important;padding-bottom:0!important;}
  .print-quote-template .ly-quote-items{font-size:12.8px!important;margin-top:0!important;}
  .print-quote-template .ly-quote-items th{height:6.3mm!important;font-size:13.8px!important;padding-top:1px!important;padding-bottom:1px!important;}
  .print-quote-template .ly-quote-items .item-row td{height:5.95mm!important;font-size:12.5px!important;line-height:1!important;padding-top:1px!important;padding-bottom:1px!important;}
  .print-quote-template .ly-quote-items .total-row td{height:6.1mm!important;font-size:13px!important;padding-top:1px!important;padding-bottom:1px!important;}
  .print-quote-template .ly-notice-block{font-size:10.4px!important;line-height:1.08!important;margin-top:1.4mm!important;max-height:42mm!important;overflow:hidden!important;break-inside:avoid!important;page-break-inside:avoid!important;}
  .print-quote-template .ly-notice-title{font-size:10.5px!important;margin-bottom:.3mm!important;}
  .print-quote-template .ly-notice-content div,
  .print-quote-template .ly-notice-content p,
  .print-quote-template .ly-notice-content li{margin:.15mm 0!important;line-height:1.08!important;}
  .print-quote-template .ly-notice-content ol,
  .print-quote-template .ly-notice-content ul{margin:.2mm 0 .2mm 13px!important;padding:0!important;}
  .print-quote-template .excel-sign{font-size:14px!important;margin-top:2mm!important;page-break-before:avoid!important;break-before:avoid!important;page-break-inside:avoid!important;break-inside:avoid!important;}
  .print-quote-template .excel-sign span{height:4.2mm!important;width:72mm!important;}
}

/* v36: 手動預覽另存 PDF 的注意事項不要過度縮小；仍維持 A4 一頁 */
@media print{
  .print-quote-template .ly-notice-block{
    font-size:12px!important;
    line-height:1.18!important;
    margin-top:2mm!important;
    max-height:56mm!important;
    overflow:visible!important;
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }
  .print-quote-template .ly-notice-title{font-size:12.2px!important;margin-bottom:.6mm!important;}
  .print-quote-template .ly-notice-content div,
  .print-quote-template .ly-notice-content p,
  .print-quote-template .ly-notice-content li{margin:.35mm 0!important;line-height:1.18!important;}
  .print-quote-template .ly-notice-content ol,
  .print-quote-template .ly-notice-content ul{margin:.35mm 0 .35mm 14px!important;padding:0!important;}
  .print-quote-template .excel-sign{font-size:14.5px!important;margin-top:2.8mm!important;}
  .print-quote-template .excel-sign span{height:4.8mm!important;width:76mm!important;}
}

/* v37: 注意事項被壓縮過度修正；維持一頁，但不要縮到貼在一起 */
@media print{
  @page{size:A4 portrait;margin:4mm;}
  .print-quote-template .ly-quote-sheet{
    height:289mm!important;
    max-height:289mm!important;
    overflow:hidden!important;
  }
  .print-quote-template .ly-notice-block{
    font-size:13.2px!important;
    line-height:1.30!important;
    margin-top:2.8mm!important;
    max-height:66mm!important;
    overflow:visible!important;
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }
  .print-quote-template .ly-notice-title{
    font-size:13.4px!important;
    margin-bottom:.9mm!important;
  }
  .print-quote-template .ly-notice-content div,
  .print-quote-template .ly-notice-content p,
  .print-quote-template .ly-notice-content li{
    margin:.55mm 0!important;
    line-height:1.30!important;
  }
  .print-quote-template .ly-notice-content ol,
  .print-quote-template .ly-notice-content ul{
    margin:.55mm 0 .55mm 15px!important;
    padding:0!important;
  }
  .print-quote-template .excel-sign{
    font-size:15.2px!important;
    margin-top:4mm!important;
  }
  .print-quote-template .excel-sign span{
    height:5.5mm!important;
    width:78mm!important;
  }
}

/* v38: 報價單注意事項不要再被過度縮小；保留一頁但提高可讀性 */
@media print{
  @page{size:A4 portrait;margin:4mm;}
  .print-quote-template .ly-quote-sheet{
    height:289mm!important;
    max-height:289mm!important;
    overflow:hidden!important;
  }
  .print-quote-template .ly-notice-block{
    font-size:13.8px!important;
    line-height:1.36!important;
    margin-top:3.2mm!important;
    max-height:78mm!important;
    overflow:visible!important;
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }
  .print-quote-template .ly-notice-title{
    font-size:14px!important;
    margin-bottom:1.0mm!important;
  }
  .print-quote-template .ly-notice-content div,
  .print-quote-template .ly-notice-content p,
  .print-quote-template .ly-notice-content li{
    margin:.55mm 0!important;
    line-height:1.36!important;
  }
  .print-quote-template .ly-notice-content ol,
  .print-quote-template .ly-notice-content ul{
    margin:.55mm 0 .55mm 16px!important;
    padding:0!important;
  }
  .print-quote-template .excel-sign{
    font-size:15.5px!important;
    margin-top:4.2mm!important;
  }
  .print-quote-template .excel-sign span{
    height:5.8mm!important;
    width:80mm!important;
  }
}


/* v40: 報價單另存 PDF 放大與字型修正
   - 使用者在 PDF viewer 100% 看時不要太小。
   - 不再把注意事項壓縮到貼在表格下方。
   - 仍維持 12 條注意事項一頁內。 */
.print-quote-template .ly-notice-block{
  font-size:15px!important;
  line-height:1.42!important;
  margin-top:4.2mm!important;
  max-height:none!important;
  overflow:visible!important;
}
.print-quote-template .ly-notice-title{font-size:15.2px!important;margin-bottom:1.2mm!important;}
.print-quote-template .ly-notice-content div,
.print-quote-template .ly-notice-content p,
.print-quote-template .ly-notice-content li{margin:.65mm 0!important;line-height:1.42!important;}
.print-quote-template .ly-notice-content ol,
.print-quote-template .ly-notice-content ul{margin:.65mm 0 .65mm 17px!important;padding:0!important;}
.print-quote-template .excel-sign{font-size:16.5px!important;margin-top:6mm!important;}
.print-quote-template .excel-sign span{height:6.2mm!important;width:84mm!important;}
@media print{
  @page{size:A4 portrait;margin:4mm;}
  .print-quote-template .ly-quote-sheet{
    width:202mm!important;
    min-height:289mm!important;
    height:289mm!important;
    max-height:289mm!important;
    padding:3.5mm 4mm 3.5mm 4mm!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }
  .print-quote-template .ly-company-wrap-cell{height:24.5mm!important;}
  .print-quote-template .ly-company-wrap{height:24.5mm!important;}
  .print-quote-template .ly-logo-img{max-height:22mm!important;max-width:31mm!important;}
  .print-quote-template .ly-company-name-cell{font-size:26px!important;line-height:8.2mm!important;}
  .print-quote-template .ly-company-line-cell{font-size:14px!important;line-height:5.9mm!important;}
  .print-quote-template .ly-doc-title-cell{height:7.2mm!important;font-size:20.5px!important;line-height:7.2mm!important;}
  .print-quote-template .ly-customer-head td{height:7.3mm!important;font-size:15px!important;line-height:1.08!important;padding-top:0!important;padding-bottom:0!important;}
  .print-quote-template .ly-quote-items{font-size:13.3px!important;margin-top:.4mm!important;}
  .print-quote-template .ly-quote-items th{height:6.4mm!important;font-size:14.2px!important;padding-top:1px!important;padding-bottom:1px!important;}
  .print-quote-template .ly-quote-items .item-row td{height:6.25mm!important;font-size:13.1px!important;line-height:1.06!important;padding-top:1px!important;padding-bottom:1px!important;}
  .print-quote-template .ly-quote-items .total-row td{height:6.5mm!important;font-size:13.8px!important;padding-top:1px!important;padding-bottom:1px!important;}
  .print-quote-template .ly-notice-block{
    font-size:13.9px!important;
    line-height:1.34!important;
    margin-top:4mm!important;
    max-height:70mm!important;
    overflow:visible!important;
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }
  .print-quote-template .ly-notice-title{font-size:14.1px!important;margin-bottom:1mm!important;}
  .print-quote-template .ly-notice-content div,
  .print-quote-template .ly-notice-content p,
  .print-quote-template .ly-notice-content li{margin:.5mm 0!important;line-height:1.34!important;}
  .print-quote-template .ly-notice-content ol,
  .print-quote-template .ly-notice-content ul{margin:.5mm 0 .5mm 16px!important;padding:0!important;}
  .print-quote-template .excel-sign{font-size:15.6px!important;margin-top:5.5mm!important;page-break-before:avoid!important;break-before:avoid!important;}
  .print-quote-template .excel-sign span{height:6mm!important;width:82mm!important;}
}


/* v41: 報價單預覽與列印 PDF 再放大；簽名欄緊接注意事項後顯示，不再被推到頁面最底下。 */
.print-quote-template .ly-quote-sheet{
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
}
.print-quote-template .ly-quote-items th{font-size:15.8px!important;line-height:1.15!important;height:6.2mm!important;}
.print-quote-template .ly-quote-items .item-row td{font-size:15.2px!important;line-height:1.15!important;height:5.75mm!important;padding-top:1px!important;padding-bottom:1px!important;}
.print-quote-template .ly-quote-items .total-row td{font-size:15.8px!important;height:6.5mm!important;}
.print-quote-template .ly-notice-block{font-size:16px!important;line-height:1.48!important;margin-top:4.8mm!important;max-height:none!important;overflow:visible!important;}
.print-quote-template .ly-notice-title{font-size:16.2px!important;margin-bottom:1.2mm!important;}
.print-quote-template .ly-notice-content div,
.print-quote-template .ly-notice-content p,
.print-quote-template .ly-notice-content li{font-size:16px!important;line-height:1.48!important;margin:.55mm 0!important;}
.print-quote-template .ly-notice-content ol,
.print-quote-template .ly-notice-content ul{margin:.55mm 0 .55mm 18px!important;padding:0!important;}
.print-quote-template .excel-sign{font-size:18px!important;margin-top:6mm!important;display:block!important;text-align:right!important;}
.print-quote-template .excel-sign span{width:86mm!important;height:6.5mm!important;}
@media print{
  @page{size:A4 portrait;margin:4mm;}
  .print-quote-template .ly-quote-sheet{
    width:202mm!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    padding:3.5mm 4mm!important;
    box-sizing:border-box!important;
    overflow:visible!important;
    page-break-after:avoid!important;
  }
  .print-quote-template .ly-company-wrap-cell{height:23mm!important;}
  .print-quote-template .ly-company-wrap{height:23mm!important;}
  .print-quote-template .ly-logo-img{max-height:21mm!important;max-width:31mm!important;}
  .print-quote-template .ly-company-name-cell{font-size:27px!important;line-height:8mm!important;}
  .print-quote-template .ly-company-line-cell{font-size:14.5px!important;line-height:5.7mm!important;}
  .print-quote-template .ly-doc-title-cell{height:6.8mm!important;font-size:21px!important;line-height:6.8mm!important;}
  .print-quote-template .ly-customer-head td{height:6.9mm!important;font-size:15.5px!important;line-height:1.1!important;}
  .print-quote-template .ly-quote-items th{font-size:15px!important;height:5.8mm!important;line-height:1.1!important;}
  .print-quote-template .ly-quote-items .item-row td{font-size:14.4px!important;height:5.35mm!important;line-height:1.08!important;}
  .print-quote-template .ly-quote-items .total-row td{font-size:15px!important;height:6mm!important;}
  .print-quote-template .ly-notice-block{font-size:14.8px!important;line-height:1.40!important;margin-top:3.5mm!important;max-height:none!important;overflow:visible!important;break-inside:avoid!important;page-break-inside:avoid!important;}
  .print-quote-template .ly-notice-title{font-size:15px!important;margin-bottom:.8mm!important;}
  .print-quote-template .ly-notice-content div,
  .print-quote-template .ly-notice-content p,
  .print-quote-template .ly-notice-content li{font-size:14.8px!important;line-height:1.40!important;margin:.35mm 0!important;}
  .print-quote-template .ly-notice-content ol,
  .print-quote-template .ly-notice-content ul{margin:.35mm 0 .35mm 16px!important;padding:0!important;}
  .print-quote-template .excel-sign{font-size:16.5px!important;margin-top:4.2mm!important;break-inside:avoid!important;page-break-inside:avoid!important;}
  .print-quote-template .excel-sign span{height:6mm!important;width:82mm!important;}
}

/* v45：預覽/手動列印使用英數優先 + 中文 fallback，讓 Chrome/Windows 自動依字元選字型。
   英數用 Times/Liberation Serif；中文在英文字型沒有字形時會 fallback 到標楷體/cwTeXKai。 */
.print-quote-template .ly-quote-sheet,
.print-quote-template .ly-quote-sheet *,
.print-quote-template .ly-company-name-cell,
.print-quote-template .ly-company-line-cell,
.print-quote-template .ly-doc-title-cell,
.print-quote-template .ly-customer-head td,
.print-quote-template .ly-quote-items th,
.print-quote-template .ly-quote-items td,
.print-quote-template .ly-notice-block,
.print-quote-template .ly-notice-block *,
.print-quote-template .excel-sign,
.print-quote-template .excel-sign *{
  font-family:"Times New Roman","Liberation Serif","DejaVu Serif","DFKai-SB","BiauKai","cwTeXKai","cwTeX Kai","標楷體","PMingLiU","MingLiU","Noto Serif TC",serif!important;
}

/* v46: 以「訂購報價單更新版0520_For硬體用」為範本，放大明細格線高度。
   目標：15 列明細的格子高度接近原始硬體報價單，避免目前匯出的報價單格子過小。 */
.print-quote-template .ly-quote-items{
  width:100%!important;
  table-layout:fixed!important;
  border-collapse:collapse!important;
}
.print-quote-template .ly-quote-items th{
  height:7.8mm!important;
  font-size:15.6px!important;
  line-height:1.14!important;
  padding-top:1px!important;
  padding-bottom:1px!important;
}
.print-quote-template .ly-quote-items .item-row td{
  height:8.05mm!important;
  font-size:15.0px!important;
  line-height:1.16!important;
  padding-top:1px!important;
  padding-bottom:1px!important;
}
.print-quote-template .ly-quote-items .total-row td{
  height:8.2mm!important;
  font-size:15.8px!important;
  line-height:1.18!important;
  padding-top:1px!important;
  padding-bottom:1px!important;
}
.print-quote-template .ly-notice-block{
  margin-top:5.0mm!important;
}
.print-quote-template .excel-sign{
  margin-top:6.5mm!important;
}
@media print{
  @page{size:A4 portrait;margin:4mm;}
  .print-quote-template .ly-quote-sheet{
    width:202mm!important;
    min-height:0!important;
    height:auto!important;
    max-height:none!important;
    padding:3.5mm 4mm!important;
    box-sizing:border-box!important;
    overflow:visible!important;
  }
  .print-quote-template .ly-quote-items th{
    height:7.6mm!important;
    font-size:15.0px!important;
    line-height:1.12!important;
  }
  .print-quote-template .ly-quote-items .item-row td{
    height:7.85mm!important;
    font-size:14.6px!important;
    line-height:1.12!important;
  }
  .print-quote-template .ly-quote-items .total-row td{
    height:8.0mm!important;
    font-size:15.2px!important;
    line-height:1.15!important;
  }
  .print-quote-template .ly-notice-block{
    margin-top:4.8mm!important;
    font-size:14.0px!important;
    line-height:1.30!important;
  }
  .print-quote-template .ly-notice-title{font-size:14.2px!important;}
  .print-quote-template .ly-notice-content div,
  .print-quote-template .ly-notice-content p,
  .print-quote-template .ly-notice-content li{
    font-size:14.0px!important;
    line-height:1.30!important;
    margin:.35mm 0!important;
  }
  .print-quote-template .excel-sign{
    margin-top:5.5mm!important;
    font-size:16px!important;
  }
}

/* v54: 會計正式報表：資產負債表 / 綜合損益表 */
.financial-statement{
  max-width:1180px;
  margin:0 auto;
  background:#fff;
  color:#222;
  font-family:"DFKai-SB","BiauKai","cwTeXKai","cwTeX Kai","標楷體","PMingLiU","MingLiU",serif;
  font-size:18px;
  line-height:1.35;
  padding:14px 18px 18px;
}
.statement-toolbar{max-width:1180px;margin:0 auto 10px;text-align:right;}
.statement-top{display:grid;grid-template-columns:1fr 1fr 1fr;align-items:start;margin-bottom:6px;}
.statement-title{text-align:center;font-size:22px;line-height:1.28;font-weight:500;}
.statement-meta{white-space:pre-line;font-size:18px;padding-top:42px;}
.statement-history{white-space:pre-line;font-size:18px;text-align:left;justify-self:end;min-width:210px;}
.balance-sheet-table,.income-statement-table{width:100%;border-collapse:collapse;table-layout:fixed;border-top:2px solid #111;border-bottom:2px solid #111;}
.balance-sheet-table th,.income-statement-table th{font-weight:400;text-align:left;border-bottom:2px solid #111;padding:2px 4px;white-space:nowrap;}
.balance-sheet-table td,.income-statement-table td{padding:2px 4px;vertical-align:top;height:26px;}
.balance-sheet-table .num,.income-statement-table .num{text-align:right;font-variant-numeric:tabular-nums;white-space:pre;}
.balance-sheet-table .divider{width:28px;text-align:center;color:#111;}
.balance-sheet-table th:nth-child(1),.balance-sheet-table td:nth-child(1){width:85px;}
.balance-sheet-table th:nth-child(2),.balance-sheet-table td:nth-child(2){width:230px;}
.balance-sheet-table th:nth-child(3),.balance-sheet-table td:nth-child(3){width:80px;}
.balance-sheet-table th:nth-child(4),.balance-sheet-table td:nth-child(4){width:120px;}
.balance-sheet-table th:nth-child(6),.balance-sheet-table td:nth-child(6){width:85px;}
.balance-sheet-table th:nth-child(7),.balance-sheet-table td:nth-child(7){width:230px;}
.balance-sheet-table th:nth-child(8),.balance-sheet-table td:nth-child(8){width:80px;}
.balance-sheet-table th:nth-child(9),.balance-sheet-table td:nth-child(9){width:120px;}
.income-statement-table th:nth-child(1),.income-statement-table td:nth-child(1){width:120px;}
.income-statement-table th:nth-child(2),.income-statement-table td:nth-child(2){width:auto;}
.income-statement-table th:nth-child(3),.income-statement-table td:nth-child(3){width:130px;}
.income-statement-table th:nth-child(4),.income-statement-table td:nth-child(4){width:190px;}
.income-statement-table th:nth-child(5),.income-statement-table td:nth-child(5){width:110px;}
.stmt-row-major td,.stmt-major td{font-weight:500;}
.stmt-row-group td,.stmt-major td{font-weight:500;}
.stmt-row-subtotal td,.stmt-subtotal td,.stmt-total td{padding-top:4px;}
.stmt-row-total td,.stmt-row-grand td,.stmt-total td{font-weight:500;}
.stmt-row-sep td,.stmt-sep td,.stmt-double td{color:#222;}
@media print{
  body:not(.print-body){background:#fff!important;}
  body:not(.print-body) .app-header,
  body:not(.print-body) .sidebar,
  body:not(.print-body) .search-panel,
  body:not(.print-body) .no-print,
  body:not(.print-body) .muted.no-print{display:none!important;}
  body:not(.print-body) .main,
  body:not(.print-body) .content{margin:0!important;padding:0!important;max-width:none!important;}
  @page{size:A4 landscape;margin:7mm;}
  .financial-statement{max-width:none;width:100%;padding:0;font-size:17px;line-height:1.28;}
  .statement-title{font-size:20px;}
  .statement-meta,.statement-history{font-size:16px;}
  .balance-sheet-table td,.income-statement-table td{height:22px;padding:1px 3px;}
  .balance-sheet-table th,.income-statement-table th{padding:1px 3px;}
}


/* v55: 會計報表表頭避免重疊，報表使用較穩定的固定欄寬 */
.financial-statement{max-width:1220px;}
.balance-sheet-table{table-layout:fixed;font-size:18px;}
.balance-sheet-table th{font-size:17px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:clip;}
.balance-sheet-table td{font-size:18px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:clip;}
.balance-sheet-table th:nth-child(1),.balance-sheet-table td:nth-child(1){width:9%;}
.balance-sheet-table th:nth-child(2),.balance-sheet-table td:nth-child(2){width:23%;}
.balance-sheet-table th:nth-child(3),.balance-sheet-table td:nth-child(3){width:6%;text-align:center;}
.balance-sheet-table th:nth-child(4),.balance-sheet-table td:nth-child(4){width:12%;}
.balance-sheet-table th:nth-child(5),.balance-sheet-table td:nth-child(5){width:3%;}
.balance-sheet-table th:nth-child(6),.balance-sheet-table td:nth-child(6){width:9%;}
.balance-sheet-table th:nth-child(7),.balance-sheet-table td:nth-child(7){width:23%;}
.balance-sheet-table th:nth-child(8),.balance-sheet-table td:nth-child(8){width:6%;text-align:center;}
.balance-sheet-table th:nth-child(9),.balance-sheet-table td:nth-child(9){width:9%;}
.income-statement-table{table-layout:fixed;font-size:18px;}
.income-statement-table th{font-size:18px;line-height:1.15;white-space:nowrap;}
.income-statement-table td{font-size:18px;line-height:1.25;}
@media print{
  .financial-statement{max-width:none;width:100%;font-size:16.5px;line-height:1.22;}
  .balance-sheet-table{font-size:16px;}
  .balance-sheet-table th{font-size:15.5px;}
  .balance-sheet-table td{font-size:16px;height:21px;padding:1px 2px;}
  .income-statement-table{font-size:16.5px;}
  .income-statement-table th,.income-statement-table td{font-size:16.5px;}
}

/* v57: 資產負債表欄位完整顯示，不再出現左邊/右邊字樣，並補回直線欄 */
.balance-sheet-table th:nth-child(3),
.balance-sheet-table td:nth-child(3),
.balance-sheet-table th:nth-child(8),
.balance-sheet-table td:nth-child(8){text-align:center;}
.balance-sheet-table th:nth-child(5),
.balance-sheet-table td:nth-child(5){text-align:center;}
.balance-sheet-table th{white-space:nowrap;}
.balance-sheet-table th:nth-child(1),.balance-sheet-table td:nth-child(1){width:8%;}
.balance-sheet-table th:nth-child(2),.balance-sheet-table td:nth-child(2){width:23%;}
.balance-sheet-table th:nth-child(3),.balance-sheet-table td:nth-child(3){width:8%;}
.balance-sheet-table th:nth-child(4),.balance-sheet-table td:nth-child(4){width:12%;}
.balance-sheet-table th:nth-child(5),.balance-sheet-table td:nth-child(5){width:4%;}
.balance-sheet-table th:nth-child(6),.balance-sheet-table td:nth-child(6){width:8%;}
.balance-sheet-table th:nth-child(7),.balance-sheet-table td:nth-child(7){width:23%;}
.balance-sheet-table th:nth-child(8),.balance-sheet-table td:nth-child(8){width:8%;}
.balance-sheet-table th:nth-child(9),.balance-sheet-table td:nth-child(9){width:12%;}
@media print{
  .balance-sheet-table th{font-size:14.5px;}
  .balance-sheet-table td{font-size:15px;}
}


/* v59: 會計報表列印/PDF 專用修正：移除系統抬頭列，並避免資產負債表欄位被切到 */
@media print{
  body:not(.print-body) .topbar,
  body:not(.print-body) .sidebar,
  body:not(.print-body) .search-panel,
  body:not(.print-body) .statement-toolbar,
  body:not(.print-body) .toolbar,
  body:not(.print-body) .no-print{
    display:none!important;
  }
  body:not(.print-body) .layout{display:block!important;min-height:0!important;}
  body:not(.print-body) .main,
  body:not(.print-body) .content{
    margin:0!important;
    padding:0!important;
    width:100%!important;
    max-width:none!important;
  }
  body:not(.print-body) .card{
    border:0!important;
    box-shadow:none!important;
    border-radius:0!important;
    padding:0!important;
    margin:0!important;
    overflow:visible!important;
  }
  @page{size:A4 landscape;margin:5mm;}
  .financial-statement{
    max-width:none!important;
    width:100%!important;
    padding:0!important;
    margin:0!important;
    font-size:13.2px!important;
    line-height:1.15!important;
    overflow:visible!important;
  }
  .statement-top{margin-bottom:2px!important;}
  .statement-title{font-size:16px!important;line-height:1.15!important;}
  .statement-meta,.statement-history{font-size:13px!important;line-height:1.2!important;padding-top:22px!important;}
  .statement-history{min-width:145px!important;}
  .balance-sheet-table{
    width:100%!important;
    table-layout:fixed!important;
    font-size:13px!important;
    line-height:1.12!important;
    border-top:2px solid #111!important;
    border-bottom:2px solid #111!important;
  }
  .balance-sheet-table th{
    font-size:11.2px!important;
    line-height:1.05!important;
    padding:0 1px!important;
    white-space:nowrap!important;
    overflow:visible!important;
    text-overflow:clip!important;
    font-weight:400!important;
  }
  .balance-sheet-table td{
    font-size:13px!important;
    line-height:1.12!important;
    padding:0 1px!important;
    height:auto!important;
    min-height:16px!important;
    white-space:nowrap!important;
    overflow:visible!important;
    text-overflow:clip!important;
  }
  .balance-sheet-table th:nth-child(1),.balance-sheet-table td:nth-child(1){width:7%!important;}
  .balance-sheet-table th:nth-child(2),.balance-sheet-table td:nth-child(2){width:20%!important;}
  .balance-sheet-table th:nth-child(3),.balance-sheet-table td:nth-child(3){width:7%!important;text-align:center!important;}
  .balance-sheet-table th:nth-child(4),.balance-sheet-table td:nth-child(4){width:11%!important;}
  .balance-sheet-table th:nth-child(5),.balance-sheet-table td:nth-child(5){width:2.5%!important;text-align:center!important;}
  .balance-sheet-table th:nth-child(6),.balance-sheet-table td:nth-child(6){width:7%!important;}
  .balance-sheet-table th:nth-child(7),.balance-sheet-table td:nth-child(7){width:20%!important;}
  .balance-sheet-table th:nth-child(8),.balance-sheet-table td:nth-child(8){width:7%!important;text-align:center!important;}
  .balance-sheet-table th:nth-child(9),.balance-sheet-table td:nth-child(9){width:11.5%!important;}
  .balance-sheet-table td:nth-child(2),
  .balance-sheet-table td:nth-child(7){
    white-space:normal!important;
    word-break:keep-all!important;
  }
  .balance-sheet-table .num{white-space:nowrap!important;text-align:right!important;}
  .balance-sheet-table .divider{width:auto!important;text-align:center!important;}
}

/* v62: 批次修改與商品分類層級 */
.batch-edit-form table{min-width:1200px;}
.batch-edit-form td{vertical-align:top;}
.batch-input{min-width:140px;}
.batch-select{min-width:170px;}
.batch-textarea{min-width:220px;}
.alert.info{background:#eef6ff;border:1px solid #bfdbfe;color:#1e3a8a;}
.alert.warning{background:#fff7ed;border:1px solid #fed7aa;color:#7c2d12;}

.current-stock-cell{min-width:90px;text-align:right;font-variant-numeric:tabular-nums;color:#0f172a;background:#f8fafc;}



/* v70: 客戶報價單「列印 / 匯出 PDF」專用版型微調
   參考使用者提供的一頁版報價單，避免 v69 過度壓縮行距。
   只套用列印 / Chrome 匯出 PDF，不影響一般預覽與 Excel。 */
@media print{
  @page{size:A4 portrait;margin:4mm;}
  body.print-body.print-quote-template{
    background:#fff!important;
    margin:0!important;
    padding:0!important;
  }
  .print-quote-template .print-toolbar,
  .print-quote-template .app-header,
  .print-quote-template .topbar,
  .print-quote-template nav,
  .print-quote-template .no-print{
    display:none!important;
  }
  .print-quote-template .ly-quote-sheet{
    width:202mm!important;
    min-height:0!important;
    height:289mm!important;
    max-height:289mm!important;
    padding:2.8mm 4.2mm 2.8mm 4.2mm!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
    page-break-before:avoid!important;
    page-break-after:avoid!important;
    break-before:avoid!important;
    break-after:avoid!important;
  }
  .print-quote-template .ly-company-wrap-cell{height:23.5mm!important;}
  .print-quote-template .ly-company-wrap{height:23.5mm!important;}
  .print-quote-template .ly-logo-img{max-height:22mm!important;max-width:33mm!important;}
  .print-quote-template .ly-company-name-cell{font-size:27px!important;line-height:8.1mm!important;}
  .print-quote-template .ly-company-line-cell{font-size:14.4px!important;line-height:5.35mm!important;}
  .print-quote-template .ly-doc-title-cell{height:6.8mm!important;font-size:20.5px!important;line-height:6.8mm!important;}
  .print-quote-template .ly-customer-head td{
    height:7.0mm!important;
    font-size:14.8px!important;
    line-height:1.12!important;
    padding-top:.15mm!important;
    padding-bottom:.15mm!important;
  }
  .print-quote-template .ly-quote-items{
    margin-top:.7mm!important;
    font-size:14.1px!important;
    table-layout:fixed!important;
    page-break-inside:avoid!important;
    break-inside:avoid!important;
  }
  .print-quote-template .ly-quote-items th{
    height:6.6mm!important;
    font-size:14.6px!important;
    line-height:1.13!important;
    padding-top:.35mm!important;
    padding-bottom:.35mm!important;
  }
  .print-quote-template .ly-quote-items .item-row td{
    height:7.05mm!important;
    font-size:13.8px!important;
    line-height:1.18!important;
    padding-top:.35mm!important;
    padding-bottom:.35mm!important;
  }
  .print-quote-template .ly-quote-items .total-row td{
    height:7.0mm!important;
    font-size:14.8px!important;
    line-height:1.15!important;
    padding-top:.35mm!important;
    padding-bottom:.35mm!important;
  }
  .print-quote-template .ly-notice-block{
    margin-top:4.8mm!important;
    font-size:14.2px!important;
    line-height:1.34!important;
    max-height:none!important;
    overflow:visible!important;
    break-before:avoid!important;
    page-break-before:avoid!important;
    break-inside:auto!important;
    page-break-inside:auto!important;
  }
  .print-quote-template .ly-notice-title{
    font-size:14.6px!important;
    margin-bottom:1.1mm!important;
    line-height:1.22!important;
  }
  .print-quote-template .ly-notice-content div,
  .print-quote-template .ly-notice-content p,
  .print-quote-template .ly-notice-content li{
    font-size:14.2px!important;
    line-height:1.34!important;
    margin:.48mm 0!important;
  }
  .print-quote-template .ly-notice-content ol,
  .print-quote-template .ly-notice-content ul{
    margin:.48mm 0 .48mm 16px!important;
    padding:0!important;
  }
  .print-quote-template .excel-sign{
    margin-top:4.4mm!important;
    font-size:16px!important;
    line-height:1.18!important;
    display:block!important;
    text-align:right!important;
    break-before:avoid!important;
    page-break-before:avoid!important;
  }
  .print-quote-template .excel-sign span{
    width:82mm!important;
    height:5.8mm!important;
  }
}

/* v71 customer e-signature */
.signed-quote-sign{display:block;text-align:right;margin-top:5mm;font-size:16px;}
.signed-signature-image{max-width:280px;max-height:56px;vertical-align:middle;margin-left:8px;object-fit:contain;}
.signed-signature-text{display:inline-block;min-width:220px;border-bottom:1px solid #000;text-align:center;margin-left:8px;font-size:18px;}
.signed-signature-meta{text-align:right;font-size:12px;margin-top:2px;}
@media print{.signed-signature-meta{font-size:11px}.signed-signature-image{max-height:48px}}

/* v85: 單據打單中清單 */
.doc-session-card{border-left:6px solid #f59e0b;}
.doc-session-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px;}
.doc-session-head h2{margin:0 0 4px;font-size:20px;}
.doc-session-table th,.doc-session-table td{white-space:nowrap;}
.doc-session-table .badge{display:inline-block;padding:3px 8px;border-radius:999px;background:#fff7ed;border:1px solid #fed7aa;color:#9a3412;font-weight:700;font-size:12px;}
@media (max-width:800px){.doc-session-head{display:block}.doc-session-head .btn{margin-top:8px}.doc-session-table th,.doc-session-table td{white-space:normal;}}

/* v91.5: 左側選單捲動穩定，避免換頁時先跳頂端再回原位置。 */
.sidebar{scroll-behavior:auto!important;overscroll-behavior:contain;will-change:scroll-position;}
html.aspa-preload .sidebar{scroll-behavior:auto!important;}
.menu-link{scroll-margin-top:0;}

/* v92 公司共用行事曆 */
.badge{display:inline-block;padding:3px 8px;border-radius:999px;background:#f1f5f9;border:1px solid #cbd5e1;color:#334155;font-weight:700;font-size:12px;}
.badge.ok{background:#ecfdf5;border-color:#86efac;color:#166534;}

/* v93.4 dotmatrix */
.print-dotmatrix > .print-toolbar:first-child{display:none;}
.dotmatrix-help{max-width:980px;margin:0 auto 12px;}
.print-dotmatrix .dotmatrix-sheet{font-family:Consolas,'Courier New','Noto Sans Mono CJK TC',monospace;font-size:13px;line-height:1.25;background:#fff;color:#111;border:1px solid #ddd;padding:14px;margin:0 auto;max-width:980px;white-space:pre;overflow:auto;}
@media print{.dotmatrix-help{display:none!important}.print-dotmatrix .dotmatrix-sheet{border:0;margin:0;padding:0;font-size:11pt;}}

/* v94.1：銷貨/進貨 HTML 列印不要把客戶名稱、單據編號用省略號取代。 */
.print-slip .slip-meta td,.print-slip .slip-meta-value,.print-slip .slip-address-value{overflow:visible!important;text-overflow:clip!important;}

/* v94.3 dotmatrix graphic driver print */
.print-dotmatrix-graphic .dotmatrix-graphic-sheet{background:#fff;margin:14px auto;padding:0;width:9.5in;height:5.5in;box-shadow:0 8px 30px rgba(0,0,0,.16);overflow:hidden}
.print-dotmatrix-graphic .dotmatrix-graphic-sheet svg{display:block;width:9.5in;height:5.5in;background:#fff}
@media print{
  .print-dotmatrix-graphic .dotmatrix-help,.print-dotmatrix-graphic .dotmatrix-action-toolbar{display:none!important}
  .print-dotmatrix-graphic .dotmatrix-graphic-sheet{box-shadow:none;margin:0;padding:0;width:9.5in;height:5.5in;overflow:hidden;page:dotmatrixGraphic}
  .print-dotmatrix-graphic .dotmatrix-graphic-sheet svg{width:9.5in;height:5.5in}
  @page dotmatrixGraphic{size:9.5in 5.5in;margin:0}
}

/* v94.7 維護 / 訂閱多軟體註冊帳號列表：改為直向排列，避免橫向撐開表格 */
.software-account-cell{white-space:normal!important;min-width:220px;max-width:360px;}
.software-account-list{display:flex;flex-direction:column;gap:3px;line-height:1.45;white-space:normal;}
.software-account-item{display:block;white-space:normal;word-break:break-all;}

/* v94.8: 維護 / 訂閱管理日期狀態顏色 */
.service-contract-date{font-weight:700;white-space:nowrap;}
.service-contract-date-ok{color:#15803d;}
.service-contract-date-warning{color:#ca8a04;}
.service-contract-date-danger{color:#dc2626;}


/* v98.5: 報價單輸出固定 A4，一頁完成。
   修正原因：v94.3 點矩陣圖形列印的 @page 9.5in 5.5in 原本是全域規則，
   會蓋掉報價單 A4，導致報價單被切成 9.5x5.5 三頁。 */
@media print{
  body.print-body.print-quote-template{
    background:#fff!important;
    margin:0!important;
    padding:0!important;
  }
  body.print-body.print-quote-template .print-toolbar{
    display:none!important;
  }
  body.print-body.print-quote-template .ly-quote-sheet{
    display:block!important;
    width:202mm!important;
    height:289mm!important;
    min-height:0!important;
    max-height:289mm!important;
    margin:0!important;
    padding:4mm 4.5mm!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
    page-break-before:avoid!important;
    page-break-after:avoid!important;
    break-before:avoid!important;
    break-after:avoid!important;
  }
  body.print-body.print-quote-template .ly-main-header,
  body.print-body.print-quote-template .ly-customer-head,
  body.print-body.print-quote-template .ly-quote-items{
    page-break-inside:avoid!important;
    break-inside:avoid!important;
  }
  body.print-body.print-quote-template .ly-company-wrap-cell{height:24mm!important;}
  body.print-body.print-quote-template .ly-company-wrap{height:24mm!important;}
  body.print-body.print-quote-template .ly-logo-img{max-height:22.5mm!important;max-width:34mm!important;}
  body.print-body.print-quote-template .ly-company-name-cell{font-size:27px!important;line-height:8.2mm!important;height:8.2mm!important;}
  body.print-body.print-quote-template .ly-company-line-cell{font-size:15px!important;line-height:5.5mm!important;height:5.5mm!important;}
  body.print-body.print-quote-template .ly-doc-title-cell{height:7.5mm!important;font-size:22px!important;line-height:7.5mm!important;}
  body.print-body.print-quote-template .ly-customer-head td{
    height:7.2mm!important;
    font-size:15px!important;
    line-height:1.08!important;
    padding-top:.1mm!important;
    padding-bottom:.1mm!important;
  }
  body.print-body.print-quote-template .ly-quote-items{
    margin-top:1mm!important;
    table-layout:fixed!important;
  }
  body.print-body.print-quote-template .ly-quote-items th{
    height:7.2mm!important;
    font-size:14.8px!important;
    line-height:1.08!important;
    padding-top:.25mm!important;
    padding-bottom:.25mm!important;
  }
  body.print-body.print-quote-template .ly-quote-items .item-row td{
    height:9.4mm!important;
    font-size:14.2px!important;
    line-height:1.08!important;
    padding-top:.25mm!important;
    padding-bottom:.25mm!important;
  }
  body.print-body.print-quote-template .ly-quote-items .total-row td{
    height:8.5mm!important;
    font-size:15.5px!important;
    line-height:1.08!important;
    padding-top:.25mm!important;
    padding-bottom:.25mm!important;
  }
  body.print-body.print-quote-template .ly-notice-block{
    margin-top:4mm!important;
    font-size:12.4px!important;
    line-height:1.32!important;
    max-height:78mm!important;
    overflow:hidden!important;
    break-before:avoid!important;
    page-break-before:avoid!important;
  }
  body.print-body.print-quote-template .ly-notice-title{
    font-size:13px!important;
    margin-bottom:.8mm!important;
    line-height:1.2!important;
  }
  body.print-body.print-quote-template .ly-notice-content div,
  body.print-body.print-quote-template .ly-notice-content p,
  body.print-body.print-quote-template .ly-notice-content li{
    font-size:12.4px!important;
    line-height:1.32!important;
    margin:.28mm 0!important;
  }
  body.print-body.print-quote-template .ly-notice-content ol,
  body.print-body.print-quote-template .ly-notice-content ul{
    margin:.28mm 0 .28mm 15px!important;
    padding:0!important;
  }
  body.print-body.print-quote-template .excel-sign{
    margin-top:5mm!important;
    font-size:14px!important;
    line-height:1.15!important;
    display:block!important;
    text-align:right!important;
    break-before:avoid!important;
    page-break-before:avoid!important;
  }
  body.print-body.print-quote-template .excel-sign span{
    width:82mm!important;
    height:6mm!important;
  }
  @page{size:A4 portrait;margin:4mm;}
}


/* v98.6: 報價單 A4 一頁填滿調整。
   放大明細列距、注意事項行距與簽回區，避免內容集中在上半部。 */


/* v102.1: 合約列表操作欄避免撐出卡片邊界 */
.contract-list-table{overflow-x:auto;max-width:100%;}
.contract-list-table table{min-width:980px;}
.contract-actions{
  white-space:normal!important;
  min-width:220px;
  max-width:300px;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-items:center;
}
.contract-actions a{
  display:inline-block;
  padding:4px 7px;
  border:1px solid #d1d5db;
  border-radius:6px;
  background:#fff;
  text-decoration:none;
  line-height:1.25;
  font-size:13px;
}

/* v102.1: 文字式簽署加粗加大，不加灰框 */
.contract-signature-text,
.signed-signature-text{
  font-size:18px!important;
  font-weight:800!important;
  color:#000!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
.contract-party-sign-line span{
  font-size:18px!important;
  font-weight:800!important;
  color:#000!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}



/* v102.2: 維護合約列表補刪除按鈕，form 不撐版 */
.contract-actions .contract-delete-form{
  display:inline-block;
  margin:0;
}
.contract-actions .contract-delete-btn{
  display:inline-block;
  padding:4px 7px;
  border:1px solid #fecaca;
  border-radius:6px;
  background:#fff;
  line-height:1.25;
  font-size:13px;
  text-decoration:none;
  margin:0;
}


/* v123.6.3: 維護 / 訂閱管理在桌面完整顯示；窄畫面固定狀態與操作欄 */
.service-contract-card{width:100%;max-width:100%;min-width:0;overflow:hidden;}
.service-contract-toolbar{align-items:flex-start;gap:10px;flex-wrap:wrap;}
.service-contract-toolbar h1{min-width:160px;}
.service-contract-toolbar-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;max-width:100%;}
.service-contract-toolbar-actions .btn{margin:0;}
.service-contract-filters{flex-wrap:wrap;}
.service-contract-list-table{
  display:block;
  width:100%;
  max-width:100%;
  min-width:0;
  overflow-x:auto;
  overflow-y:visible;
  -webkit-overflow-scrolling:touch;
  padding-bottom:8px;
}
.service-contract-list-table .service-contract-table{
  width:100%;
  min-width:1080px;
  max-width:none;
  table-layout:fixed;
  margin:0;
}
.service-contract-table .col-type{width:6.5%;}
.service-contract-table .col-title{width:14.5%;}
.service-contract-table .col-customer{width:13%;}
.service-contract-table .col-reminder{width:10%;}
.service-contract-table .col-expiry{width:10%;}
.service-contract-table .col-amount{width:8%;}
.service-contract-table .col-software{width:18%;}
.service-contract-table .col-owner{width:7%;}
.service-contract-table .col-status{width:6%;}
.service-contract-table .col-actions{width:6%;}
.service-contract-list-table th,
.service-contract-list-table td{
  white-space:normal!important;
  word-break:break-word;
  overflow-wrap:anywhere;
  vertical-align:top;
}
.service-contract-list-table td.service-contract-date-cell,
.service-contract-list-table td.service-contract-amount,
.service-contract-list-table td.service-contract-status-cell{white-space:nowrap!important;}
.service-contract-list-table td.service-contract-amount{text-align:right;}
.service-contract-list-table td.service-contract-software-cell{word-break:break-all;line-height:1.55;}
.service-contract-list-table td.service-contract-actions{white-space:normal!important;min-width:0;}
.service-contract-actions .btn{display:inline-block;margin:0;white-space:nowrap;padding:6px 9px;}
/* 窄螢幕或瀏覽器縮放時，狀態與操作永遠留在右側 */
.service-contract-table th:nth-child(10),
.service-contract-table td:nth-child(10){
  position:sticky;
  right:0;
  z-index:3;
  background:#fff;
  border-left:1px solid var(--line);
}
.service-contract-table th:nth-child(9),
.service-contract-table td:nth-child(9){
  position:sticky;
  right:72px;
  z-index:2;
  background:#fff;
  box-shadow:-5px 0 8px rgba(15,23,42,.06);
}
.service-contract-table thead th:nth-child(9),
.service-contract-table thead th:nth-child(10){background:#f9fafb;z-index:5;}
@media(max-width:1180px){
  .service-contract-list-table .service-contract-table{min-width:1080px;}
}
@media(max-width:760px){
  .service-contract-card{padding-left:12px;padding-right:12px;}
  .service-contract-list-table .service-contract-table{width:1080px;min-width:1080px;}
  .service-contract-table th:nth-child(9),
  .service-contract-table td:nth-child(9){right:72px;}
}



/* v104.0：進貨 / 銷貨商品搜尋與單據唯讀鎖定 */
.product-lookup-field{display:grid;grid-template-columns:minmax(210px,1fr) 42px 34px;gap:5px;align-items:center;min-width:330px}
.product-lookup-field .js-product-lookup-display{min-width:210px;background:#fff;color:#111827}
.product-lookup-btn,.product-lookup-clear{height:36px;border:1px solid #94a3b8;border-radius:7px;background:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:20px;line-height:1}
.product-lookup-btn:hover{background:#e0f2fe;border-color:#0284c7}
.product-lookup-clear{font-size:22px;color:#64748b}
.product-lookup-clear:hover{background:#fee2e2;border-color:#ef4444;color:#b91c1c}
.product-lookup-btn:disabled,.product-lookup-clear:disabled{cursor:not-allowed;opacity:.55}
.doc-lock-fieldset{border:0;padding:0;margin:0;min-width:0}
.doc-view-locked .form-control:disabled,.doc-view-locked .form-select:disabled,.doc-view-locked textarea:disabled{background:#f1f5f9;color:#334155;opacity:1;border-color:#cbd5e1}
.doc-view-locked .product-lookup-btn,.doc-view-locked .product-lookup-clear{background:#e2e8f0}
.doc-view-locked .aspa-editor-body{background:#f1f5f9;color:#334155;pointer-events:none}
.doc-view-locked .aspa-editor-toolbar{display:none}
.doc-lock-notice{border-left:5px solid #2563eb}
.product-lookup-popup{margin:0;background:#eef2f7;color:#0f172a;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans TC",Arial,sans-serif}
.product-lookup-main{padding:18px;max-width:1500px;margin:0 auto}
.product-lookup-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:12px}
.product-lookup-head h1{margin:0 0 6px;font-size:24px}
.product-lookup-head p{margin:0}
.product-lookup-search{position:sticky;top:0;z-index:5;box-shadow:0 5px 18px rgba(15,23,42,.08)}
.product-lookup-search-row{display:grid;grid-template-columns:minmax(260px,1fr) auto auto;gap:8px;align-items:center}
.product-lookup-search .field-hint{margin-top:8px}
.product-lookup-table-wrap{padding:0;overflow:auto;max-height:calc(100vh - 225px)}
.product-lookup-table{min-width:980px}
.product-lookup-table thead th{position:sticky;top:0;z-index:2;background:#1f5f91;color:#fff}
.product-lookup-table tbody tr:hover td{background:#e0f2fe}
.product-lookup-table tbody tr.is-selected td{background:#fef3c7}
.product-lookup-table .lookup-product-name{font-weight:700;white-space:normal;min-width:260px}
@media(max-width:760px){.product-lookup-field{grid-template-columns:minmax(180px,1fr) 40px 32px;min-width:280px}.product-lookup-search-row{grid-template-columns:1fr}.product-lookup-head{display:block}.product-lookup-head .btn{margin-top:10px}}


/* v105.0 進貨 / 銷貨單桌面式輸入與「...」參照視窗 */
.slip-entry-header-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 16px;align-items:start;margin-bottom:8px}
.slip-entry-field{min-width:0}
.slip-entry-field.span-3{grid-column:1/-1}
.slip-entry-field-doc-no .form-control.readonly,.slip-entry-field-doc-no input[readonly]{background:#e5e7eb;color:#334155;font-weight:700}
.required-mark{color:#dc2626;font-weight:700}
.reference-lookup-field{display:grid;grid-template-columns:minmax(0,1fr) 42px 34px;gap:5px;align-items:center;min-width:250px}
.slip-reference-lookup{grid-template-columns:minmax(90px,.42fr) minmax(145px,1fr) 42px 34px}
.reference-lookup-field .form-control[readonly]{background:#fff;color:#111827;cursor:default}
.reference-lookup-field .lookup-code{font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace}
.reference-lookup-btn,.reference-lookup-clear{height:36px;border:1px solid #94a3b8;border-radius:7px;background:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:1;font-weight:700}
.reference-lookup-btn{font-size:17px;letter-spacing:1px;color:#0f3f68}
.reference-lookup-btn:hover{background:#e0f2fe;border-color:#0284c7}
.reference-lookup-clear{font-size:21px;color:#64748b}
.reference-lookup-clear:hover{background:#fee2e2;border-color:#ef4444;color:#b91c1c}
.reference-lookup-btn:disabled,.reference-lookup-clear:disabled{cursor:not-allowed;opacity:.55;background:#e2e8f0}
.item-reference-lookup{min-width:245px}
.item-reference-lookup.is-product-lookup{min-width:315px}
.doc-view-locked .reference-lookup-field .form-control[readonly]{background:#e2e8f0}
.reference-lookup-table td{vertical-align:middle}
.reference-lookup-table tbody tr{cursor:default}
.reference-lookup-table tbody tr:hover td{background:#e0f2fe}
@media(max-width:1180px){.slip-entry-header-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.slip-entry-field.span-3{grid-column:1/-1}}
@media(max-width:760px){.slip-entry-header-grid{grid-template-columns:1fr}.slip-entry-field.span-3{grid-column:auto}.slip-reference-lookup{grid-template-columns:minmax(80px,.45fr) minmax(120px,1fr) 40px 32px}.reference-lookup-field{grid-template-columns:minmax(160px,1fr) 40px 32px;min-width:250px}}

/* v106.0：進貨單 / 銷貨單改為傳統桌面進銷存輸入介面 */
.legacy-slip-panel,
.legacy-slip-items,
.legacy-slip-bottom{font-family:"Microsoft JhengHei","Noto Sans TC",sans-serif;color:#4b3f37}
.legacy-slip-panel{border:1px solid #a8a29e;background:#efefef;margin:-10px -10px 0;padding:10px 12px 0;border-radius:2px 2px 0 0}
.legacy-slip-header{display:grid;grid-template-columns:repeat(3,minmax(300px,1fr));gap:7px 26px;align-items:center}
.legacy-line-field{display:grid;grid-template-columns:108px minmax(0,1fr) 34px;gap:4px;align-items:center;min-width:0}
.legacy-line-field:not(:has(.legacy-ellipsis-btn)):not(:has(.legacy-small-action)){grid-template-columns:108px minmax(0,1fr)}
.legacy-label{font-size:16px;color:#554b43;white-space:nowrap;text-align:left;line-height:1.2}
.legacy-name-label,.legacy-code-label{color:#2356d8}
.legacy-input,.legacy-table-input,.legacy-table-select{height:34px;border:1px solid #9b9b9b;border-radius:0;background:#fff;padding:4px 7px;font-size:16px;color:#1f2937;box-shadow:inset 0 1px 2px rgba(0,0,0,.04)}
.legacy-input:focus,.legacy-table-input:focus,.legacy-table-select:focus{outline:2px solid #2f75b5;outline-offset:-2px}
.legacy-input.readonly,.legacy-input[readonly]{background:#e7e7e7;color:#384152}
.legacy-ellipsis-btn,.legacy-binocular-btn,.legacy-small-action{height:34px;min-width:32px;border:1px solid #9b9b9b;border-radius:0;background:linear-gradient(#fff,#e4e4e4);color:#111827;font-size:15px;font-weight:700;cursor:pointer;padding:0 6px}
.legacy-ellipsis-btn:hover,.legacy-binocular-btn:hover,.legacy-small-action:hover{background:#dbeafe;border-color:#3974a8}
.legacy-lookup-pair{grid-column:1/-1!important;display:grid!important;grid-template-columns:108px minmax(260px,1.3fr) 108px minmax(150px,.7fr) 34px!important;gap:4px!important;align-items:center;min-width:0}
.legacy-lookup-pair .legacy-name-label{grid-column:1}.legacy-lookup-pair .js-reference-lookup-name{grid-column:2}.legacy-lookup-pair .legacy-code-label{grid-column:3}.legacy-lookup-pair .legacy-code-input{grid-column:4}.legacy-lookup-pair .legacy-ellipsis-btn{grid-column:5}
.legacy-slip-header .reference-lookup-field{min-width:0}
.legacy-slip-header .reference-lookup-field.legacy-line-field{display:grid;grid-template-columns:108px minmax(0,1fr) 34px;gap:4px}
.legacy-quick-row{margin:10px -12px 0;padding:7px 12px;border-top:1px solid #b7b7b7;background:#f4f4f4;display:flex;align-items:center;gap:4px;flex-wrap:wrap}
.legacy-quick-btn{height:34px;border:1px solid #8a8a8a;border-radius:0;background:linear-gradient(#fff,#e6e6e6);padding:4px 18px;font-size:15px;color:#3f332d;cursor:pointer}
.legacy-quick-btn:hover{background:#dbeafe}
.legacy-counts{margin-left:auto;display:flex;gap:34px;font-size:16px}.legacy-counts strong{color:#f43f5e;font-weight:500}
.legacy-slip-items{margin:0 -10px;background:#ddd8d2;border-left:1px solid #a8a29e;border-right:1px solid #a8a29e}
.legacy-table-scroll{overflow:auto;min-height:300px;max-height:430px;background:#d7d1ca}
.legacy-slip-table{width:100%;min-width:1120px;border-collapse:collapse;table-layout:fixed;background:#fff}
.legacy-slip-table th{position:sticky;top:0;z-index:2;background:#2f6f9f;color:#eef7ff;border:1px solid #c6c6c6;font-size:16px;font-weight:500;height:34px;padding:3px 5px;text-align:center}
.legacy-slip-table td{border:1px solid #b7b7b7;height:34px;padding:0;background:#fff;vertical-align:middle}
.legacy-slip-table tbody tr:hover td{background:#eff6ff}
.legacy-slip-table th:nth-child(1){width:28px}.legacy-slip-table th:nth-child(2){width:170px}.legacy-slip-table th:nth-child(3){width:310px}.legacy-slip-table th:nth-child(4){width:80px}.legacy-slip-table th:nth-child(5){width:105px}.legacy-slip-table th:nth-child(6){width:120px}.legacy-slip-table th:nth-child(7){width:140px}.legacy-slip-table th:nth-child(8){width:220px}.legacy-slip-table th:nth-child(9){width:70px}
.legacy-row-marker{background:#f4f4f4!important}.legacy-slip-table .row-no{text-align:center;background:#f0f0f0;color:#333}
.legacy-table-input,.legacy-table-select{width:100%;height:33px;border:0;font-size:15px;background:transparent}.legacy-table-input.num{text-align:right;color:#244ec7}.legacy-table-select{padding-right:2px}
.legacy-product-cell{display:grid!important;grid-template-columns:minmax(0,1fr) 34px!important;gap:0!important;min-width:0!important;height:33px}.legacy-product-cell .legacy-product-code{grid-column:1}.legacy-product-cell .legacy-binocular-btn{grid-column:2;border-top:0;border-right:0;border-bottom:0;height:33px;font-size:17px;padding:0}
.legacy-slip-table .line-amount{text-align:right;padding:0 7px;color:#244ec7;font-size:15px}.legacy-explain-check{width:18px;height:18px}.legacy-item-actions{padding:6px 10px;background:#efefef;border-top:1px solid #b7b7b7}
.legacy-slip-bottom{margin:0 -10px -10px;border:1px solid #a8a29e;background:#efefef;padding:9px 12px 8px}
.legacy-total-grid{display:grid;grid-template-columns:repeat(4,minmax(250px,1fr));gap:22px}.legacy-total-col{display:grid;gap:5px}.legacy-total-col .legacy-line-field{grid-template-columns:115px minmax(0,1fr) 58px}.legacy-total-col .legacy-line-field:not(:has(.legacy-small-action)){grid-template-columns:115px minmax(0,1fr)}
.legacy-total-col .legacy-input{text-align:right}.legacy-total-col select.legacy-input{text-align:left}
/* v123.6.50：進／銷貨底部的發票號碼屬文字欄位，固定靠左顯示。 */
.legacy-total-col input.legacy-input[name="invoice_no"]{text-align:left}
.legacy-tax-choice{margin:7px 0 0 auto;border:1px solid #a8a29e;background:#f7f7f7;display:flex;align-items:center;justify-content:flex-end;gap:28px;padding:7px 18px;max-width:560px;font-size:16px}.legacy-tax-title{color:#ef4444;font-weight:700}.legacy-tax-choice label{cursor:pointer}.legacy-tax-choice input{width:17px;height:17px;vertical-align:-3px}
.doc-view-locked .legacy-input,.doc-view-locked .legacy-table-input,.doc-view-locked .legacy-table-select{background:#e5e7eb!important}.doc-view-locked .legacy-ellipsis-btn,.doc-view-locked .legacy-binocular-btn,.doc-view-locked .legacy-quick-btn{opacity:.55;cursor:not-allowed}
@media(max-width:1400px){.legacy-slip-header{grid-template-columns:repeat(2,minmax(300px,1fr))}.legacy-lookup-pair{grid-column:1/-1!important}.legacy-total-grid{grid-template-columns:repeat(2,minmax(280px,1fr))}}
@media(max-width:850px){.legacy-slip-header{grid-template-columns:1fr}.legacy-lookup-pair{grid-template-columns:100px minmax(0,1fr) 34px!important}.legacy-lookup-pair .legacy-name-label{grid-column:1}.legacy-lookup-pair .js-reference-lookup-name{grid-column:2}.legacy-lookup-pair .legacy-code-label{grid-column:1}.legacy-lookup-pair .legacy-code-input{grid-column:2}.legacy-lookup-pair .legacy-ellipsis-btn{grid-column:3;grid-row:1/3}.legacy-total-grid{grid-template-columns:1fr}.legacy-counts{width:100%;margin-left:0;justify-content:space-between;gap:8px}.legacy-tax-choice{max-width:none;justify-content:space-between;gap:8px}}

/* v106.0：進貨單／銷貨單桌面程式式功能列與快捷鍵狀態列。 */
.legacy-slip-toolbar{display:flex;align-items:stretch;gap:0;flex-wrap:wrap;margin:0 0 8px;border:1px solid #9b9b9b;background:#ececec;box-shadow:inset 0 1px #fff;min-height:54px}
.legacy-toolbar-form{display:flex;margin:0;padding:0}
.legacy-toolbar-btn{appearance:none;display:inline-flex;min-width:62px;min-height:52px;box-sizing:border-box;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:3px 8px;border:0;border-right:1px solid #b8b8b8;border-radius:0;background:linear-gradient(#f8f8f8,#e6e6e6);color:#42372f;font-family:"Microsoft JhengHei","Noto Sans TC",sans-serif;font-size:15px;line-height:1.05;text-decoration:none;cursor:pointer}
.legacy-toolbar-btn:hover{background:linear-gradient(#eef7ff,#d8ebfb);color:#173b5c}
.legacy-toolbar-btn:focus{outline:2px solid #2f75b5;outline-offset:-3px}
.legacy-toolbar-btn.is-disabled{color:#aaa;background:#ededed;cursor:not-allowed;text-shadow:0 1px #fff}
.legacy-toolbar-icon{display:block;height:23px;font-size:21px;line-height:23px;font-family:"Segoe UI Symbol","Microsoft JhengHei",sans-serif;font-weight:400}
.legacy-toolbar-save{color:#174a70;font-weight:700}.legacy-toolbar-post{color:#8b4513;font-weight:700}.legacy-toolbar-danger{color:#9f1239}.legacy-toolbar-exit{margin-left:6px;border-left:1px solid #a8a8a8}
.legacy-function-bar{display:flex;align-items:center;gap:18px;overflow:auto;white-space:nowrap;margin:0 -10px -10px;padding:7px 10px;border-top:1px solid #9b9b9b;background:#f7f7f7;color:#2f55d4;font-family:"Microsoft JhengHei","Noto Sans TC",sans-serif;font-size:15px}
.legacy-function-bar strong{align-self:stretch;display:flex;align-items:center;margin:-7px 0 -7px -10px;padding:7px 12px;background:#119b91;color:#fff;font-weight:500}
@media(max-width:850px){.legacy-toolbar-btn{min-width:56px;font-size:13px;padding:3px 5px}.legacy-function-bar{gap:12px;font-size:13px}}

/* v106.0：依指定畫面固定進／銷貨單表頭位置。 */
.legacy-slip-header-grid{display:grid;grid-template-columns:repeat(3,minmax(300px,1fr));grid-template-rows:repeat(5,34px);gap:7px 26px;align-items:center}
.legacy-party-group{display:contents}
.legacy-header-cell{min-width:0}
.legacy-header-cell .legacy-line-field{width:100%}
.legacy-pos-date{grid-column:1;grid-row:1}.legacy-pos-docno{grid-column:2;grid-row:1}.legacy-pos-party-code{grid-column:3;grid-row:1}
.legacy-pos-party-name{grid-column:1;grid-row:2}.legacy-pos-address{grid-column:2/4;grid-row:2}
.legacy-pos-employee{grid-column:1;grid-row:3}.legacy-pos-contact{grid-column:2;grid-row:3}.legacy-pos-department{grid-column:3;grid-row:3}
.legacy-pos-creator{grid-column:1;grid-row:4}.legacy-pos-currency{grid-column:2;grid-row:4}.legacy-pos-rate{grid-column:3;grid-row:4}
.legacy-pos-notes{grid-column:1/3;grid-row:5}.legacy-pos-print{grid-column:3;grid-row:5}
.legacy-slip-header-grid .legacy-line-field{display:grid;grid-template-columns:108px minmax(0,1fr) 34px;gap:4px;align-items:center}
.legacy-slip-header-grid .legacy-line-field:not(:has(.legacy-ellipsis-btn)):not(:has(.legacy-small-action)){grid-template-columns:108px minmax(0,1fr)}
@media(max-width:1400px){.legacy-slip-header-grid{grid-template-columns:repeat(2,minmax(300px,1fr));grid-template-rows:auto}.legacy-pos-date,.legacy-pos-docno,.legacy-pos-party-code,.legacy-pos-party-name,.legacy-pos-address,.legacy-pos-employee,.legacy-pos-contact,.legacy-pos-department,.legacy-pos-creator,.legacy-pos-currency,.legacy-pos-rate,.legacy-pos-notes,.legacy-pos-print{grid-column:auto;grid-row:auto}.legacy-pos-address,.legacy-pos-notes{grid-column:1/-1}}
@media(max-width:850px){.legacy-slip-header-grid{grid-template-columns:1fr}.legacy-pos-address,.legacy-pos-notes{grid-column:auto}}
.legacy-binocular-btn{font-size:0;background-color:#f1f1f1;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23111827' d='M6.3 4h3.2l1.1 4h2.8l1.1-4h3.2l3.2 12.3A2.2 2.2 0 0 1 18.8 19H16a3 3 0 0 1-3-3v-1h-2v1a3 3 0 0 1-3 3H5.2a2.2 2.2 0 0 1-2.1-2.7L6.3 4Zm-.8 10-1 3.1c-.1.4.2.9.7.9H8a2 2 0 1 0 0-4H5.5Zm13 0H16a2 2 0 1 0 0 4h2.8c.5 0 .8-.5.7-.9l-1-3.1ZM8 9a3 3 0 0 1 2.8 2h2.4A3 3 0 0 1 16 9h1.3l-1-4h-1l-1.1 4H9.8L8.7 5h-1l-1 4H8Z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:center;background-size:22px 22px}


/* v111.0：多行單據備註與送貨地址選擇。 */
.legacy-multiline-input{height:34px;min-height:34px;line-height:24px;padding-top:4px;padding-bottom:4px;resize:none;white-space:pre-wrap;overflow:hidden}
.legacy-delivery-address-field{display:grid!important;grid-template-columns:108px minmax(0,1fr) 34px!important;gap:4px!important;align-items:center}
.legacy-delivery-address-field .js-delivery-address-display{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.legacy-slip-table th .required-mark{font-size:16px;margin-left:2px}


/* v113：常用作業流程與台灣會計帳款處理 */
.erp-major-workflow{background:linear-gradient(135deg,#f97316 0%,#dc2626 100%)!important;color:#fff!important;border:1px solid rgba(255,255,255,.3)!important;box-shadow:0 8px 20px rgba(220,38,38,.3)!important}
.erp-workflow-sidebar{margin:0 6px 12px;padding:6px;border:1px solid rgba(251,146,60,.55);border-radius:10px;background:rgba(124,45,18,.16)}
.erp-workflow-subgroup{color:#fed7aa!important;font-weight:800!important;margin-top:8px!important}
.erp-workflow-link{display:flex!important;align-items:center;gap:7px;border-left:3px solid transparent!important;background:rgba(255,255,255,.05)!important}
.erp-workflow-link:hover{border-left-color:#fb923c!important;background:rgba(251,146,60,.18)!important}
.erp-workflow-dot{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;background:#fb923c;color:#431407;font-weight:900;flex:0 0 18px}
.erp-daily-workflow{margin-bottom:18px;border:2px solid #f97316;background:linear-gradient(135deg,#fff7ed 0%,#ffffff 55%,#fff1f2 100%);box-shadow:0 12px 30px rgba(194,65,12,.14)}
.erp-daily-workflow-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;margin-bottom:16px}
.erp-daily-workflow-head h1{margin:3px 0 5px;color:#9a3412}.erp-daily-workflow-head p{margin:0;color:#57534e}
.erp-daily-workflow-kicker{display:inline-block;padding:3px 9px;border-radius:999px;background:#ffedd5;color:#c2410c;font-weight:800;font-size:13px}
.erp-daily-workflow-grid{display:grid;grid-template-columns:repeat(6,minmax(150px,1fr));gap:10px}
.erp-daily-step{position:relative;display:flex;min-height:150px;flex-direction:column;padding:14px 12px 12px;border:1px solid #fed7aa;border-radius:12px;background:#fff;color:#292524;text-decoration:none;box-shadow:0 5px 14px rgba(120,53,15,.08);transition:.16s ease}
.erp-daily-step:hover{transform:translateY(-3px);border-color:#f97316;box-shadow:0 10px 22px rgba(194,65,12,.18)}
.erp-daily-step-no{display:flex;align-items:center;justify-content:center;width:31px;height:31px;margin-bottom:8px;border-radius:50%;background:#ea580c;color:#fff;font-weight:900}
.erp-daily-step strong{font-size:17px;color:#7c2d12}.erp-daily-step small{margin-top:6px;line-height:1.45;color:#78716c}.erp-daily-step-action{margin-top:auto;padding-top:10px;color:#c2410c;font-weight:800}
.erp-accounting-process-tabs{gap:8px;flex-wrap:wrap}.erp-accountant-confirm{display:flex;align-items:flex-start;gap:9px;padding:12px;border:1px solid #f59e0b;border-radius:8px;background:#fffbeb;font-weight:700}.erp-accountant-confirm input{margin-top:3px;width:18px;height:18px}
.erp-terms-flow{display:grid;gap:8px;padding-left:24px}.erp-terms-flow li{padding:7px 10px;border-left:4px solid #f97316;background:#fff7ed}
@media(max-width:1500px){.erp-daily-workflow-grid{grid-template-columns:repeat(3,minmax(180px,1fr))}}
@media(max-width:850px){.erp-daily-workflow-head{display:block}.erp-daily-workflow-head .btn{margin-top:12px}.erp-daily-workflow-grid{grid-template-columns:1fr}}


/* v113：常用必做流程更醒目，例外作業與主流程明確分離 */
.erp-major-workflow{font-size:15px!important;letter-spacing:.04em;background:linear-gradient(135deg,#b45309,#f59e0b)!important;color:#fff!important;box-shadow:0 8px 20px rgba(180,83,9,.32)!important}
.erp-major-workflow span{font-size:17px}
.erp-workflow-link{font-weight:800!important;border-left:3px solid rgba(245,158,11,.9)!important;background:rgba(245,158,11,.10)!important}
.erp-workflow-link:hover{background:rgba(245,158,11,.22)!important}
.erp-daily-workflow-kicker{font-weight:900!important;letter-spacing:.08em}
.erp-accountant-confirm{display:flex;align-items:flex-start;gap:10px;padding:13px 15px;border:1px solid #f59e0b;border-radius:10px;background:#fffbeb;font-weight:700}

/* v116.0：報價單品項區內顯示公司匯款資料。 */
.print-quote-template .ly-quote-items .remittance-row td{
  height:auto!important;
  min-height:8mm!important;
  padding:1mm 1.5mm!important;
  text-align:left!important;
  vertical-align:middle!important;
  font-size:13px!important;
  line-height:1.22!important;
  background:#fff!important;
}
.print-quote-template .ly-remittance-wrap{display:flex;align-items:flex-start;gap:1mm;min-width:0}
.print-quote-template .ly-remittance-label{font-weight:700;white-space:nowrap;flex:0 0 auto}
.print-quote-template .ly-remittance-content{flex:1 1 auto;min-width:0;word-break:break-word}
.print-quote-template .ly-remittance-content p,
.print-quote-template .ly-remittance-content div{margin:0!important;line-height:1.22!important}
.print-quote-template .ly-remittance-content ul,
.print-quote-template .ly-remittance-content ol{margin:0 0 0 18px!important;padding:0!important}
@media print{
  body.print-body.print-quote-template .ly-quote-items .remittance-row td{
    height:auto!important;
    min-height:8.2mm!important;
    padding:1mm 1.5mm!important;
    font-size:12.8px!important;
    line-height:1.22!important;
  }
}

/* v117.0：報價單簽署圖放大、匯款資料列固定清楚顯示。 */
body.print-body.print-quote-template .signed-quote-line img.signed-signature-image{
  max-width:75mm!important;
  max-height:16mm!important;
  object-fit:contain!important;
}
body.print-body.print-quote-template .ly-quote-items .remittance-row td,
body.print-body.print-quote-template .items .remittance-row td{
  height:auto!important;
  min-height:8.2mm!important;
  padding:1mm 1.5mm!important;
  text-align:left!important;
  vertical-align:top!important;
  font-size:12.8px!important;
  line-height:1.28!important;
}


/* v122.7：匯款資料移到品項表格（含總計）下方、注意事項上方，不再占用品項列。 */
/* v122.8：放大報價單匯款資料字級；預覽、列印與 PDF 同步加大。 */
.print-quote-template .ly-remittance-block{display:flex!important;align-items:flex-start!important;gap:1.4mm!important;margin:2.2mm 0 0!important;padding:1mm 0!important;border:0!important;background:transparent!important;color:#000!important;font-size:16px!important;line-height:1.36!important;break-inside:avoid!important;page-break-inside:avoid!important;}
.print-quote-template .ly-remittance-block .ly-remittance-label{font-weight:700!important;white-space:nowrap!important;flex:0 0 auto!important;}
.print-quote-template .ly-remittance-block .ly-remittance-content{flex:1 1 auto!important;min-width:0!important;word-break:break-word!important;}
.print-quote-template .ly-remittance-block .ly-remittance-content p,.print-quote-template .ly-remittance-block .ly-remittance-content div{margin:0!important;line-height:1.36!important;}
.print-quote-template .ly-remittance-block .ly-remittance-content ul,.print-quote-template .ly-remittance-block .ly-remittance-content ol{margin:0 0 0 18px!important;padding:0!important;}
.print-quote-template .ly-remittance-block + .ly-notice-block{margin-top:2.2mm!important;}
@media print{body.print-body.print-quote-template .ly-remittance-block{font-size:15px!important;line-height:1.32!important;margin-top:1.5mm!important;padding:.7mm 0!important;}body.print-body.print-quote-template .ly-remittance-block .ly-remittance-content p,body.print-body.print-quote-template .ly-remittance-block .ly-remittance-content div{line-height:1.32!important;}body.print-body.print-quote-template .ly-remittance-block + .ly-notice-block{margin-top:1.8mm!important;}}

/* v122.10：報價單輸入畫面的即時成本／報價總額。僅供後台畫面使用。 */
.quote-live-summary{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:stretch;
  gap:12px;
  margin:12px 0 4px;
}
.quote-live-total-card{
  min-width:210px;
  padding:12px 16px;
  border:1px solid #cbd5e1;
  border-radius:10px;
  background:#fff;
  box-shadow:0 1px 2px rgba(15,23,42,.05);
}
.quote-live-total-label{
  display:block;
  margin-bottom:5px;
  color:#475569;
  font-size:14px;
  font-weight:700;
}
.quote-live-total-card strong{
  display:block;
  color:#0f172a;
  font-size:24px;
  line-height:1.15;
  text-align:right;
  font-variant-numeric:tabular-nums;
}
.quote-live-cost-card{border-left:5px solid #64748b;}
.quote-live-price-card{border-left:5px solid #2563eb;}
.quote-live-summary-note{
  flex-basis:100%;
  color:#64748b;
  font-size:13px;
  text-align:right;
}
@media(max-width:760px){
  .quote-live-summary{justify-content:stretch;}
  .quote-live-total-card{flex:1 1 100%;min-width:0;}
  .quote-live-summary-note{text-align:left;}
}
@media print{
  .quote-live-summary{display:none!important;}
}


/* v123.6.1: 維護合約簽署紀錄表格響應式修正 */
.contract-signature-card{max-width:100%;overflow:hidden}
.contract-signature-table-wrap{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.contract-signature-table{width:100%;min-width:980px;table-layout:fixed;margin:0}
.contract-signature-table .col-role{width:8%}
.contract-signature-table .col-email{width:15%}
.contract-signature-table .col-signer{width:9%}
.contract-signature-table .col-status{width:17%}
.contract-signature-table .col-time{width:13%}
.contract-signature-table .col-ip{width:10%}
.contract-signature-table .col-hash{width:14%}
.contract-signature-table .col-actions{width:14%}
.contract-signature-table th,.contract-signature-table td{white-space:normal;word-break:break-word;overflow-wrap:anywhere;vertical-align:middle}
.contract-signature-table th{line-height:1.35}
.contract-signature-email{word-break:break-all}
.contract-signature-status{line-height:1.45}
.contract-signature-hash-cell{min-width:0}
.contract-signature-hash{display:inline-block;max-width:100%;font-size:12px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;cursor:help}
.contract-signature-action-list{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.contract-signature-action-list .inline-form{display:inline-flex;margin:0}
.contract-signature-action-list .btn,.contract-signature-open-link{white-space:nowrap}
.contract-signature-open-link{display:inline-block}
@media(max-width:1100px){
  .contract-signature-table{min-width:940px}
}
@media(max-width:700px){
  .contract-signature-card{padding-left:12px;padding-right:12px}
  .contract-signature-table{min-width:900px}
}


/* v123.6.4: ERP 郵件寄送紀錄與 SMTP 回應稽核 */
.email-log-toolbar{flex-wrap:wrap;}
.email-log-summary{grid-template-columns:repeat(3,minmax(0,1fr));}
.email-log-summary .stat-value{font-size:30px;}
.email-log-filter-grid{grid-template-columns:180px 220px minmax(260px,1fr) auto;align-items:end;}
.email-log-filter-actions{display:flex;gap:8px;align-items:center;padding-bottom:1px;}
.email-log-card{max-width:100%;overflow:hidden;}
.email-log-table-wrap{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;}
.email-log-table{min-width:1320px;table-layout:fixed;}
.email-log-table th:nth-child(1){width:145px;}
.email-log-table th:nth-child(2){width:150px;}
.email-log-table th:nth-child(3){width:210px;}
.email-log-table th:nth-child(4){width:260px;}
.email-log-table th:nth-child(5){width:180px;}
.email-log-table th:nth-child(6){width:130px;}
.email-log-table th:nth-child(7){width:260px;}
.email-log-table th:nth-child(8){width:120px;}
.email-log-table th,.email-log-table td{white-space:normal!important;word-break:break-word;overflow-wrap:anywhere;vertical-align:top;}
.email-log-address{word-break:break-all!important;}
.email-log-subject{line-height:1.45;}
.email-log-attachments{font-size:13px;line-height:1.45;}
.email-log-status{display:inline-block;padding:4px 9px;border-radius:999px;font-size:12px;font-weight:800;white-space:nowrap;}
.email-log-status.accepted{background:#dcfce7;color:#166534;border:1px solid #86efac;}
.email-log-status.failed{background:#fee2e2;color:#991b1b;border:1px solid #fca5a5;}
.email-log-status.processing{background:#fef3c7;color:#92400e;border:1px solid #fcd34d;}
.email-log-response details{max-width:100%;}
.email-log-response summary{cursor:pointer;color:#1d4ed8;word-break:break-all;}
.email-log-response pre{white-space:pre-wrap;word-break:break-all;background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:9px;max-width:100%;font-size:12px;line-height:1.45;}
@media(max-width:980px){
  .email-log-summary{grid-template-columns:1fr;}
  .email-log-filter-grid{grid-template-columns:1fr;}
  .email-log-filter-actions{padding:0;}
}

/* v123.6.5: 維護合約列表在瀏覽器縮放 >100% 時仍可完整操作 */
body:not(.print-body) .main{min-width:0;}
body:not(.print-body) .card{min-width:0;max-width:100%;}
body:not(.print-body) .table-wrap{min-width:0;max-width:100%;}
.contract-list-toolbar{align-items:flex-start;flex-wrap:wrap;}
.contract-list-toolbar h1{min-width:160px;}
.contract-list-toolbar-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;max-width:100%;}
.contract-list-toolbar-actions .btn{margin:0;}
.contract-list-filter-card{overflow:hidden;}
.contract-list-filters{max-width:100%;}
.contract-list-card{width:100%;max-width:100%;min-width:0;overflow:hidden;}
.contract-list-table{
  display:block;
  width:100%;
  max-width:100%;
  min-width:0;
  overflow-x:auto;
  overflow-y:visible;
  -webkit-overflow-scrolling:touch;
  padding-bottom:8px;
}
.contract-list-table .maintenance-contract-table{
  width:100%;
  min-width:1420px;
  max-width:none;
  table-layout:fixed;
  margin:0;
}
.maintenance-contract-table .contract-date-col{width:105px;}
.maintenance-contract-table .contract-no-col{width:145px;}
.maintenance-contract-table .contract-party-type-col{width:95px;}
.maintenance-contract-table .contract-party-col{width:170px;}
.maintenance-contract-table .contract-project-col{width:255px;}
.maintenance-contract-table .contract-period-col{width:205px;}
.maintenance-contract-table .contract-amount-col{width:95px;}
.maintenance-contract-table .contract-status-col{width:80px;}
.maintenance-contract-table .contract-actions-col{width:270px;}
.contract-list-table th,
.contract-list-table td{
  vertical-align:top;
}
.contract-list-table .contract-party-cell,
.contract-list-table .contract-project-cell{
  white-space:normal!important;
  word-break:break-word;
  overflow-wrap:anywhere;
  line-height:1.45;
}
.contract-list-table .contract-date-cell,
.contract-list-table .contract-no-cell,
.contract-list-table .contract-party-type-cell,
.contract-list-table .contract-period-cell,
.contract-list-table .contract-amount-cell,
.contract-list-table .contract-status-cell{
  white-space:nowrap!important;
}
.contract-list-table .contract-amount-cell{text-align:right;}
.contract-list-table .contract-actions-cell{
  white-space:normal!important;
  min-width:270px;
  width:270px;
  padding:10px;
}
.contract-list-table .contract-actions{
  width:100%;
  min-width:0;
  max-width:none;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-items:center;
}
.contract-list-table .contract-actions a,
.contract-list-table .contract-delete-btn{
  white-space:nowrap;
}
/* 右側「狀態 / 操作」固定在可視區，縮放 110%、125%、150% 時不再被切掉 */
.maintenance-contract-table .contract-actions-col,
.maintenance-contract-table .contract-actions-cell{
  position:sticky;
  right:0;
  z-index:4;
  background:#fff;
  border-left:1px solid var(--line);
}
.maintenance-contract-table .contract-status-col,
.maintenance-contract-table .contract-status-cell{
  position:sticky;
  right:270px;
  z-index:3;
  background:#fff;
  box-shadow:-5px 0 8px rgba(15,23,42,.06);
}
.maintenance-contract-table thead .contract-status-col,
.maintenance-contract-table thead .contract-actions-col{
  background:#f9fafb;
  z-index:6;
}
@media(max-width:1180px){
  .contract-list-table .maintenance-contract-table{min-width:1420px;}
}
@media(max-width:760px){
  .contract-list-card{padding-left:12px;padding-right:12px;}
  .contract-list-table .maintenance-contract-table{width:1420px;min-width:1420px;}
}


/* v123.6.10：維護案報價單 WYSIWYG。
   「預覽」與 Chromium 實際 PDF 共用同一組 A4 內容尺寸、列高、注意事項與簽回區比例，
   不再發生預覽看起來正常、下載 PDF 後高度／字級／底部位置改變。 */
body.print-body.print-quote-template.quote-wysiwyg .ly-quote-sheet{
  display:block!important;
  width:202mm!important;
  height:289mm!important;
  min-height:0!important;
  max-height:289mm!important;
  margin:0 auto!important;
  padding:4mm 4.5mm!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}
body.print-body.print-quote-template.quote-wysiwyg .ly-company-wrap-cell{height:24mm!important;}
body.print-body.print-quote-template.quote-wysiwyg .ly-company-wrap{height:24mm!important;}
body.print-body.print-quote-template.quote-wysiwyg .ly-logo-img{max-height:22.5mm!important;max-width:34mm!important;}
body.print-body.print-quote-template.quote-wysiwyg .ly-company-name-cell{font-size:27px!important;line-height:8.2mm!important;height:8.2mm!important;}
body.print-body.print-quote-template.quote-wysiwyg .ly-company-line-cell{font-size:15px!important;line-height:5.5mm!important;height:5.5mm!important;}
body.print-body.print-quote-template.quote-wysiwyg .ly-doc-title-cell{height:7.5mm!important;font-size:22px!important;line-height:7.5mm!important;}
body.print-body.print-quote-template.quote-wysiwyg .ly-customer-head td{
  height:7.2mm!important;
  font-size:15px!important;
  line-height:1.08!important;
  padding-top:.1mm!important;
  padding-bottom:.1mm!important;
}
body.print-body.print-quote-template.quote-wysiwyg .ly-quote-items{margin-top:1mm!important;table-layout:fixed!important;}
body.print-body.print-quote-template.quote-wysiwyg .ly-quote-items th{
  height:7.2mm!important;
  font-size:14.8px!important;
  line-height:1.08!important;
  padding-top:.25mm!important;
  padding-bottom:.25mm!important;
}
body.print-body.print-quote-template.quote-wysiwyg .ly-quote-items .item-row td{
  height:9.4mm!important;
  font-size:14.2px!important;
  line-height:1.08!important;
  padding-top:.25mm!important;
  padding-bottom:.25mm!important;
}
body.print-body.print-quote-template.quote-wysiwyg .ly-quote-items .total-row td{
  height:8.5mm!important;
  font-size:15.5px!important;
  line-height:1.08!important;
  padding-top:.25mm!important;
  padding-bottom:.25mm!important;
}
body.print-body.print-quote-template.quote-wysiwyg .ly-remittance-block{
  font-size:15px!important;
  line-height:1.32!important;
  margin:1.5mm 0 0!important;
  padding:.7mm 0!important;
}
body.print-body.print-quote-template.quote-wysiwyg .ly-remittance-block .ly-remittance-content p,
body.print-body.print-quote-template.quote-wysiwyg .ly-remittance-block .ly-remittance-content div{line-height:1.32!important;}
body.print-body.print-quote-template.quote-wysiwyg .ly-remittance-block + .ly-notice-block{margin-top:1.8mm!important;}
body.print-body.print-quote-template.quote-wysiwyg .ly-notice-block{
  margin-top:4mm!important;
  font-size:12.4px!important;
  line-height:1.32!important;
  max-height:78mm!important;
  overflow:hidden!important;
  break-before:avoid!important;
  page-break-before:avoid!important;
}
body.print-body.print-quote-template.quote-wysiwyg .ly-notice-title{font-size:13px!important;margin-bottom:.8mm!important;line-height:1.2!important;}
body.print-body.print-quote-template.quote-wysiwyg .ly-notice-content div,
body.print-body.print-quote-template.quote-wysiwyg .ly-notice-content p,
body.print-body.print-quote-template.quote-wysiwyg .ly-notice-content li{
  font-size:12.4px!important;
  line-height:1.32!important;
  margin:.28mm 0!important;
}
body.print-body.print-quote-template.quote-wysiwyg .ly-notice-content ol,
body.print-body.print-quote-template.quote-wysiwyg .ly-notice-content ul{margin:.28mm 0 .28mm 15px!important;padding:0!important;}
body.print-body.print-quote-template.quote-wysiwyg .excel-sign{
  margin-top:5mm!important;
  font-size:14px!important;
  line-height:1.15!important;
  display:block!important;
  text-align:right!important;
  break-before:avoid!important;
  page-break-before:avoid!important;
}
body.print-body.print-quote-template.quote-wysiwyg .excel-sign span{width:82mm!important;height:6mm!important;}
@media print{
  @page{size:A4 portrait;margin:4mm;}
  body.print-body.print-quote-template.quote-wysiwyg{background:#fff!important;margin:0!important;padding:0!important;}
  body.print-body.print-quote-template.quote-wysiwyg .ly-quote-sheet{margin:0!important;}
}


/* v123.6.11：維護案報價單恢復 13／14 條。
   6～12 與空白的第 13 條使用相同六欄 compact 格式；第 13 條只有在有補充內容時才切成紅字整行。
   compact 列縮短高度，補回兩列後仍保留原本注意事項／簽回的 A4 頁尾空間。 */
.print-quote-template .ly-maintenance-items .compact-row td{height:7.2mm;line-height:1.05;}
.print-quote-template .ly-maintenance-items .emphasis-row td{height:9.4mm;line-height:1.08;}
body.print-body.print-quote-template.quote-wysiwyg .ly-maintenance-items .compact-row td{height:7.2mm!important;line-height:1.05!important;}
body.print-body.print-quote-template.quote-wysiwyg .ly-maintenance-items .emphasis-row td{height:9.4mm!important;line-height:1.08!important;}
@media print{
  .print-quote-template .ly-maintenance-items .compact-row td{height:7.2mm!important;line-height:1.05!important;}
  .print-quote-template .ly-maintenance-items .emphasis-row td{height:9.4mm!important;line-height:1.08!important;}
}

/* v123.6.20：硬體／軟體報價單多筆主單備註 */
.quote-notes-editor{border:1px solid #cbd5e1;border-radius:10px;padding:12px;background:#f8fafc;}
.quote-notes-editor-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px;}
.quote-notes-editor-head .form-label{margin-bottom:2px;}
.quote-notes-editor-list{display:grid;gap:10px;}
.quote-note-editor-item{border:1px solid #dbe3ec;border-radius:8px;padding:10px;background:#fff;}
.quote-note-editor-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:6px;}
.quote-note-editor-item .aspa-editor{margin-top:0;}
.quote-note-editor-item .aspa-editor-body{min-height:82px;}
@media (max-width:700px){.quote-notes-editor-head{flex-direction:column;align-items:stretch}.quote-notes-editor-head .btn{align-self:flex-start}}

/* v123.6.22: 商品主檔清單欄位排序 */
.erp-product-sort-hint{margin:-4px 0 8px 2px;font-size:13px;}
th.erp-sortable-th{padding:0;}
.erp-sort-link{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:10px;color:inherit;text-decoration:none;white-space:nowrap;}
.erp-sort-link:hover{background:#eef4ff;color:#0f4ea6;}
th.erp-sortable-th.is-active{background:#eef4ff;}
th.erp-sortable-th.is-active .erp-sort-link{color:#0f4ea6;}
.erp-sort-indicator{font-size:11px;line-height:1;color:#64748b;}
th.erp-sortable-th.is-active .erp-sort-indicator{color:#0f4ea6;}

/* v123.6.26: 零元紀錄（公司無收支） */
.legacy-zero-value-panel{margin-top:8px;border:1px solid #a8a29e;background:#f8fafc;padding:9px 12px;display:grid;grid-template-columns:minmax(250px,360px) minmax(280px,420px) 1fr;gap:14px;align-items:end}
.legacy-zero-value-field{display:grid;grid-template-columns:120px minmax(0,1fr);gap:8px;align-items:center}.legacy-zero-value-field label{font-weight:700}.legacy-zero-value-help{font-size:13px;line-height:1.45;color:#475569}
@media(max-width:1100px){.legacy-zero-value-panel{grid-template-columns:1fr}.legacy-zero-value-field{grid-template-columns:120px minmax(0,1fr)}}

/* v123.6.37：左側導覽改為模組摺疊 + 功能搜尋 + 我的最愛；既有 route 不變。 */
.erp-sidebar-tools{padding:12px 12px 8px;border-bottom:1px solid rgba(255,255,255,.08);background:#111b2d;position:sticky;top:0;z-index:5;}
.erp-nav-search-label{display:block;margin:0 0 6px;color:#cbd5e1;font-size:12px;font-weight:700;letter-spacing:.5px;}
.erp-nav-search{width:100%;height:36px;padding:7px 10px;border:1px solid rgba(148,163,184,.35);border-radius:9px;background:#0f172a;color:#f8fafc;outline:none;font-size:13px;}
.erp-nav-search::placeholder{color:#64748b;}.erp-nav-search:focus{border-color:#60a5fa;box-shadow:0 0 0 2px rgba(96,165,250,.16);}
.erp-nav-home{padding:7px 8px 2px}.erp-nav-home-link{border-radius:9px;margin:0;padding:10px 12px!important;font-weight:800;background:rgba(255,255,255,.045);}
.erp-nav-favorites{margin:8px 8px 10px;border:1px solid rgba(251,191,36,.22);border-radius:10px;background:rgba(251,191,36,.055);overflow:hidden;}
.erp-nav-favorites-title{padding:8px 10px 6px;color:#fde68a;font-size:12px;font-weight:800;letter-spacing:.5px;}
.erp-nav-favorites-list{max-height:170px;overflow:auto;padding:0 4px 5px;}.erp-nav-favorites-empty{padding:5px 7px 8px;color:#64748b;font-size:12px;}
.erp-nav-section{margin:7px 8px;border:1px solid rgba(148,163,184,.15);border-radius:11px;background:rgba(255,255,255,.025);overflow:hidden;}
.erp-nav-section-toggle{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 12px;border:0;background:transparent;color:#e2e8f0;font:inherit;font-size:14px;font-weight:800;text-align:left;cursor:pointer;}
.erp-nav-section-toggle:hover{background:rgba(255,255,255,.06)}.erp-nav-section-toggle:focus-visible{outline:2px solid #60a5fa;outline-offset:-2px;}
.erp-nav-section-icon{display:inline-flex;width:22px;justify-content:center;margin-right:6px;color:#93c5fd;}
.erp-nav-chevron{font-size:16px;color:#94a3b8;transition:transform .16s ease;}.erp-nav-section.is-open .erp-nav-chevron{transform:rotate(180deg);}
.erp-nav-section-panel{display:none;padding:0 0 6px;}.erp-nav-section.is-open>.erp-nav-section-panel{display:block;}
.erp-nav-subgroup{padding-top:2px}.erp-nav-subgroup+.erp-nav-subgroup{border-top:1px solid rgba(148,163,184,.08);margin-top:4px;padding-top:5px;}
.erp-nav-section .menu-subgroup{margin:6px 10px 3px;padding:0;color:#7dd3fc;font-size:11px;letter-spacing:.6px;}
.erp-nav-link-row{position:relative;display:flex;align-items:stretch;min-width:0;}
.erp-nav-link-row .menu-link{flex:1;min-width:0;padding:7px 37px 7px 14px;border-left:3px solid transparent;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;}
.erp-nav-link-row .menu-link:hover{border-left-color:#60a5fa}.erp-nav-link-row .menu-link.is-active{background:rgba(59,130,246,.16);border-left-color:#60a5fa;color:#fff;font-weight:800;}
.erp-nav-fav{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:27px;height:27px;border:0;border-radius:7px;background:transparent;color:#64748b;cursor:pointer;font-size:15px;line-height:27px;padding:0;}
.erp-nav-fav:hover{background:rgba(255,255,255,.08);color:#fbbf24}.erp-nav-fav[aria-pressed="true"]{color:#fbbf24;}
.erp-nav-favorite-row{position:relative;display:flex;align-items:center}.erp-nav-favorite-row a{display:block;flex:1;min-width:0;padding:6px 32px 6px 8px;color:#e5e7eb;text-decoration:none;font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:7px;}
.erp-nav-favorite-row a:hover{background:rgba(255,255,255,.07)}.erp-nav-favorite-remove{position:absolute;right:3px;top:50%;transform:translateY(-50%);border:0;background:transparent;color:#94a3b8;width:25px;height:25px;border-radius:6px;cursor:pointer;}.erp-nav-favorite-remove:hover{background:rgba(255,255,255,.08);color:#f87171;}
.erp-nav-section[data-search-match="0"]{display:none}.erp-nav-subgroup[data-search-match="0"]{display:none}.erp-nav-link-row[data-search-match="0"]{display:none;}
.erp-nav-section-workflow .erp-nav-section-toggle{color:#fef3c7}.erp-nav-section-workflow .erp-nav-section-icon{color:#fbbf24}.erp-nav-section-accounting .erp-nav-section-icon{color:#c4b5fd}.erp-nav-section-inventory .erp-nav-section-icon{color:#93c5fd}.erp-nav-section-work .erp-nav-section-icon{color:#5eead4}.erp-nav-section-procurement .erp-nav-section-icon{color:#c4b5fd;}
@media(max-width:980px){.erp-sidebar-tools{position:relative;top:auto}.erp-nav-section-panel{max-height:none}.erp-nav-favorites-list{max-height:none}}

/* v123.6.38：CRM 客戶管理核心。既有 ERP 客戶 / 報價 / 銷貨 / 合約資料只讀串接，不改原流程。 */
.erp-nav-section-crm .erp-nav-section-icon{color:#86efac}
.erp-crm-card{border-left-color:#16a34a!important}
.crm-subnav{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 14px;padding:8px;background:#fff;border:1px solid #dbe3ec;border-radius:10px;position:sticky;top:0;z-index:4}
.crm-subnav-link{display:inline-flex;align-items:center;min-height:34px;padding:6px 11px;border-radius:8px;color:#334155;text-decoration:none;font-weight:700;font-size:13px}
.crm-subnav-link:hover{background:#f1f5f9;color:#0f4ea6}.crm-subnav-link.is-active{background:#0f4ea6;color:#fff}
.crm-stats .stat-value{font-size:25px}
.crm-pipeline{display:grid;grid-template-columns:repeat(7,minmax(105px,1fr));gap:7px;overflow:auto;padding-bottom:3px}
.crm-pipeline-stage{display:flex;min-width:105px;min-height:96px;flex-direction:column;gap:5px;padding:10px;border:1px solid #dbe3ec;border-radius:9px;text-decoration:none;color:#1e293b;background:#f8fafc}
.crm-pipeline-stage:hover{border-color:#60a5fa;background:#eff6ff}.crm-pipeline-stage strong{font-size:13px}.crm-pipeline-stage span{font-size:20px;font-weight:800}.crm-pipeline-stage small{color:#64748b}
.crm-stage-filter{margin:0 0 12px;display:flex;gap:6px;flex-wrap:wrap}
.crm-timeline{position:relative;display:grid;gap:0}.crm-timeline:before{content:"";position:absolute;left:143px;top:4px;bottom:4px;width:2px;background:#e2e8f0}
.crm-timeline-item{position:relative;display:grid;grid-template-columns:125px 1fr;gap:36px;padding:9px 0}.crm-timeline-item:before{content:"";position:absolute;left:138px;top:18px;width:12px;height:12px;border-radius:50%;background:#2563eb;border:3px solid #dbeafe}
.crm-timeline-time{font-size:12px;color:#64748b;text-align:right;padding-top:2px}.crm-timeline-body{min-width:0}.crm-timeline-body>a{text-decoration:none;color:#0f4ea6}.crm-timeline-type{display:inline-block;margin-right:7px;padding:2px 6px;border-radius:5px;background:#e0f2fe;color:#075985;font-size:11px;font-weight:800}
.crm-overdue td{background:#fff1f2!important}.crm-overdue td:first-child{color:#b91c1c;font-weight:800}
@media(max-width:900px){.crm-subnav{position:relative;top:auto}.crm-pipeline{grid-template-columns:repeat(7,130px)}.crm-timeline:before{left:9px}.crm-timeline-item{grid-template-columns:1fr;gap:3px;padding:11px 0 11px 30px}.crm-timeline-item:before{left:4px;top:16px}.crm-timeline-time{text-align:left}.crm-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* v123.6.42：現收／現付金額恢復完整欄寬，付款方式改為獨立欄位，避免桌面版四欄被擠壓。 */
.legacy-settlement-method{text-align:left!important;min-width:0}
.legacy-payment-method-field .legacy-label{font-weight:500}
.legacy-settlement-pending{margin:10px 0 0}

/* v123.6.48: 報價單明細欄寬優化－縮小數量／單位／單價欄，將空間留給商品分類與產品名稱。 */
body:not(.print-body) .item-table[data-item-type="quote_items"]{
  width:100%;
  min-width:1080px;
  table-layout:fixed;
}
body:not(.print-body) .item-table[data-item-type="quote_items"] th:nth-child(1),
body:not(.print-body) .item-table[data-item-type="quote_items"] td:nth-child(1){width:3%;}
body:not(.print-body) .item-table[data-item-type="quote_items"] th:nth-child(2),
body:not(.print-body) .item-table[data-item-type="quote_items"] td:nth-child(2){width:17%;}
body:not(.print-body) .item-table[data-item-type="quote_items"] th:nth-child(3),
body:not(.print-body) .item-table[data-item-type="quote_items"] td:nth-child(3){width:24%;}
body:not(.print-body) .item-table[data-item-type="quote_items"] th:nth-child(4),
body:not(.print-body) .item-table[data-item-type="quote_items"] td:nth-child(4){width:6.5%;}
body:not(.print-body) .item-table[data-item-type="quote_items"] th:nth-child(5),
body:not(.print-body) .item-table[data-item-type="quote_items"] td:nth-child(5){width:7%;}
body:not(.print-body) .item-table[data-item-type="quote_items"] th:nth-child(6),
body:not(.print-body) .item-table[data-item-type="quote_items"] td:nth-child(6){width:9%;}
body:not(.print-body) .item-table[data-item-type="quote_items"] th:nth-child(7),
body:not(.print-body) .item-table[data-item-type="quote_items"] td:nth-child(7){width:9%;}
body:not(.print-body) .item-table[data-item-type="quote_items"] th:nth-child(8),
body:not(.print-body) .item-table[data-item-type="quote_items"] td:nth-child(8){width:7%;}
body:not(.print-body) .item-table[data-item-type="quote_items"] th:nth-child(9),
body:not(.print-body) .item-table[data-item-type="quote_items"] td:nth-child(9){width:12%;}
body:not(.print-body) .item-table[data-item-type="quote_items"] th:nth-child(10),
body:not(.print-body) .item-table[data-item-type="quote_items"] td:nth-child(10){width:5.5%;}
body:not(.print-body) .item-table[data-item-type="quote_items"] .form-control.small,
body:not(.print-body) .item-table[data-item-type="quote_items"] .form-select.small{
  width:100%;
  min-width:0;
  padding-left:7px;
  padding-right:7px;
}
body:not(.print-body) .item-table[data-item-type="quote_items"] td:nth-child(4) .form-control,
body:not(.print-body) .item-table[data-item-type="quote_items"] td:nth-child(6) .form-control,
body:not(.print-body) .item-table[data-item-type="quote_items"] td:nth-child(7) .form-control,
body:not(.print-body) .item-table[data-item-type="quote_items"] td:nth-child(8) .form-control{
  text-align:right;
}
@media(max-width:1200px){
  body:not(.print-body) .item-table[data-item-type="quote_items"]{min-width:1040px;}
}

/* v123.6.49: 採購單明細欄寬比照報價單優化－縮小數量／單位／進貨單價，將空間留給商品與品名摘要。 */
body:not(.print-body) .item-table[data-item-type="purchase_order_items"]{
  width:100%;
  min-width:1040px;
  table-layout:fixed;
}
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] th:nth-child(1),
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] td:nth-child(1){width:3%;}
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] th:nth-child(2),
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] td:nth-child(2){width:25%;}
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] th:nth-child(3),
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] td:nth-child(3){width:28%;}
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] th:nth-child(4),
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] td:nth-child(4){width:6.5%;}
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] th:nth-child(5),
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] td:nth-child(5){width:7%;}
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] th:nth-child(6),
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] td:nth-child(6){width:9.5%;}
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] th:nth-child(7),
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] td:nth-child(7){width:14%;}
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] th:nth-child(8),
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] td:nth-child(8){width:7%;}
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] .form-control.small,
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] .form-select.small{
  width:100%;
  min-width:0;
  padding-left:7px;
  padding-right:7px;
}
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] td:nth-child(4) .form-control,
body:not(.print-body) .item-table[data-item-type="purchase_order_items"] td:nth-child(6) .form-control{
  text-align:right;
}
@media(max-width:1200px){
  body:not(.print-body) .item-table[data-item-type="purchase_order_items"]{min-width:1000px;}
}
