:root{--ink:#16302d;--muted:#6c7f7a;--green:#176353;--light:#edf5f1;--line:#dfe7e2;--paper:#fff;--bg:#f6f8f5;--gold:#b78941;--red:#ae3e38;font-family:"Segoe UI","Microsoft JhengHei",sans-serif;font-size:15px;color:var(--ink);background:var(--bg);font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,input,select,textarea{outline-offset:3px}button{border:1px solid var(--line);background:white;color:var(--ink);padding:10px 16px;border-radius:8px;cursor:pointer;font-weight:600;white-space:nowrap}button:hover{background:var(--light);border-color:#adccc0}button:disabled{opacity:.45;cursor:not-allowed}button.primary{background:var(--green);border-color:var(--green);color:white}button.primary:hover{background:#0e4e40}button.danger{color:var(--red)}button.quiet{border:0;background:transparent;padding:6px 8px}button.small{padding:6px 10px;font-size:13px}a{color:var(--green);text-decoration:none}h1,h2,h3,p{margin-top:0}h1{font-size:30px;letter-spacing:-.7px;margin-bottom:12px}h2{font-size:19px;margin-bottom:18px}h3{font-size:16px}p{line-height:1.75;color:var(--muted)}small,.small{font-size:12px;color:var(--muted);line-height:1.65}.sidebar{position:fixed;inset:0 auto 0 0;width:230px;background:#123e35;color:#e7f0eb;padding:30px 20px;display:flex;flex-direction:column}.brand{display:flex;gap:12px;align-items:center;color:white;font-size:19px;font-weight:700}.brand small{display:block;color:#9ebeb0;letter-spacing:2px;font-size:10px}.brand-symbol{font-family:Georgia,serif;font-size:38px;line-height:1;background:#e9f0dd;color:#164437;padding:5px 10px;border-radius:10px}.brand-symbol span{color:var(--gold)}.workspace-label{font-size:11px;letter-spacing:2px;color:#90afa1;margin:45px 12px 16px}nav{display:grid;gap:7px}nav button{border:0;background:transparent;color:#c7d8d0;text-align:left;font-weight:500;padding:13px}nav button span{display:inline-block;width:30px;font-size:18px}nav button.active,nav button:hover{background:#2d584b;color:white}.sidebar-bottom{margin-top:auto;font-size:13px;color:#c7d8d0;border-top:1px solid #365b4e;padding:22px 8px 0}.sidebar-bottom small{display:block;color:#9eb5a8;margin-top:8px}.dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#b7d79b;margin-right:8px}.main-shell{margin-left:230px}.topbar{height:74px;background:white;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 38px;font-size:14px}.user-menu{display:flex;align-items:center;gap:16px}.user-menu form{margin:0}.badge{display:inline-block;padding:5px 10px;border-radius:5px;font-size:11px;letter-spacing:.5px;background:#f2ebdc;color:#876125}.test-strip{font-size:12px;color:#756a4e;padding:10px 38px;background:#fbf8ee;border-bottom:1px solid #eee8d6}#app{padding:32px 38px 50px;max-width:1600px;margin:0 auto}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:25px}.page-heading p{margin-bottom:0;font-size:14px}.eyebrow{color:var(--green);font-size:11px;font-weight:700;letter-spacing:2px;margin-bottom:12px}.hero{background:#e8efe5;border:1px solid #dbe5d8;border-radius:14px;padding:30px 34px;display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:24px}.hero h1{font-size:29px}.hero p{margin:0}.hero .number-mark{font-family:Georgia,serif;font-size:64px;font-weight:400;color:#8ca18b;white-space:nowrap;line-height:1}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:26px}.stat{border:1px solid var(--line);background:white;border-radius:10px;padding:20px 22px}.stat span{font-size:13px;color:var(--muted)}.stat strong{display:block;margin-top:13px;font-size:29px;font-weight:600;font-variant-numeric:tabular-nums}.stat small{display:block;margin-top:7px}.card{background:white;border:1px solid var(--line);border-radius:12px;padding:25px;margin-bottom:22px}.card-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}.card-heading h2{margin:0}.grid{display:grid;gap:18px}.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.span2{grid-column:1/-1}.onboarding{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-bottom:26px}.step{background:white;border:1px solid var(--line);border-radius:12px;padding:22px;text-align:left}.step .step-num{color:#8e9e8e;font-size:12px;display:block;margin-bottom:15px}.step strong{display:block;font-size:17px;margin-bottom:8px}.step p{font-size:13px;margin:0;white-space:normal}.step:hover{border-color:var(--green)}.step .done{color:var(--green)}.toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:20px}.toolbar input{max-width:450px}.toolbar .count{margin-left:auto;font-size:13px;color:var(--muted)}label{display:block;font-size:13px;font-weight:600;line-height:1.7}input,select,textarea{width:100%;border:1px solid #cfdcd4;background:white;border-radius:7px;padding:10px 11px;color:var(--ink);margin-top:5px;font-size:14px;min-width:0}input:focus,select:focus,textarea:focus{border-color:var(--green);outline:2px solid #c6e0d6}input[readonly]{background:#f4f6f3;color:#65776e}textarea{resize:vertical;min-height:80px}input[type=checkbox]{width:auto;margin:0 8px 0 0}.checkbox{display:flex;align-items:center;margin-top:15px}.table-scroll{overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:13px}th{background:#f4f7f3;text-align:left;color:#6e7f74;font-size:12px;font-weight:600;padding:12px;border-bottom:1px solid var(--line)}td{padding:14px 12px;border-bottom:1px solid #edf1ed;line-height:1.6;vertical-align:middle}tbody tr:last-child td{border-bottom:0}td strong{display:block;color:var(--ink);font-weight:600}td small{display:block}.right{text-align:right}.mono{font-variant-numeric:tabular-nums;white-space:nowrap}.tag{display:inline-block;font-size:11px;border-radius:5px;padding:3px 8px;background:#edf1ee;color:#66746a}.tag.sent,.tag.unpaid{background:#fff1d8;color:#976c26}.tag.accepted,.tag.paid,.tag.active{background:#e5f3ea;color:#2c7650}.tag.void{background:#f8e9e7;color:#a15750}.empty{text-align:center;padding:45px 20px;color:var(--muted)}.empty strong{display:block;color:#466251;font-size:17px;margin-bottom:10px}.empty p{font-size:13px}.notice{padding:15px 18px;border:1px solid #e9dfc8;background:#fffaf0;border-radius:8px;font-size:13px;line-height:1.75;color:#7d6942;margin-bottom:20px}.error{color:var(--red);padding:12px 15px;background:#fff1ef;border-radius:7px}.loading{padding:80px;text-align:center}.form-footer{display:flex;justify-content:flex-end;gap:10px;border-top:1px solid var(--line);padding-top:20px;margin-top:24px}.document-lines{min-width:870px}.document-lines td{padding:8px 5px;vertical-align:top}.document-lines th{padding:10px 5px}.document-lines input,.document-lines select{margin-top:3px;padding:8px;font-size:13px}.document-lines .line-product{font-size:12px;color:var(--muted)}.document-lines th:nth-child(2){width:27%}.document-lines th:nth-child(3){width:23%}.document-lines th:nth-child(4){width:8%}.document-lines th:nth-child(5),.document-lines th:nth-child(6){width:12%}.document-lines th:nth-child(7){width:11%}.document-lines td:first-child{padding-top:19px;color:var(--muted)}.amount-cell{padding-top:20px!important}.line-actions{display:flex;gap:10px;margin-top:18px}.totals-row{display:grid;grid-template-columns:1fr 300px;gap:35px;margin-top:24px}.totals{background:#f3f7f2;border-radius:10px;padding:18px 22px}.totals div{display:flex;justify-content:space-between;padding:9px 0;font-size:14px}.totals .grand{font-size:22px;border-top:1px solid #dce6db;margin-top:8px;padding-top:16px;font-weight:700}.editor-meta{font-size:12px;color:var(--muted);margin-bottom:20px}.sticky-actions{position:sticky;bottom:0;background:#fffef9ed;border:1px solid var(--line);border-radius:10px;padding:14px 20px;display:flex;justify-content:space-between;gap:12px;align-items:center;backdrop-filter:blur(6px);margin-top:20px}.sticky-actions div{display:flex;gap:10px}.modal-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:25px}.modal-heading h2{margin:0}dialog{border:1px solid var(--line);border-radius:14px;padding:28px;width:min(720px,94vw);max-height:90vh;box-shadow:0 25px 90px #16302d30}dialog::backdrop{background:#193c3555;backdrop-filter:blur(2px)}#toast{position:fixed;bottom:26px;left:50%;transform:translateX(-50%);padding:13px 22px;background:#143f33;color:white;border-radius:8px;z-index:20;max-width:90vw;box-shadow:0 8px 24px #0002}#toast.error-toast{background:#922f2b}.auth-body{min-height:100vh;display:grid;place-items:center;padding:25px;background:linear-gradient(135deg,#edf2e8,#f9faf7)}.auth-card{background:white;border:1px solid var(--line);padding:42px;border-radius:18px;width:min(490px,100%);box-shadow:0 16px 55px #173d2f0c}.auth-card.wide{width:min(730px,100%)}.auth-card .brand-symbol{display:inline-block;margin-bottom:28px}.auth-card h1{font-size:25px}.auth-card form{margin-top:25px}.auth-card label{margin-bottom:15px}.full{width:100%;margin:12px 0 16px}.auth-card p.small{margin:6px 0 0}#print-dialog{width:min(900px,96vw);padding:0;background:#e9ede8}.print-actions{padding:16px 20px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;background:#e9ede8;z-index:1}.print-actions div{display:flex;gap:10px}#print-sheet{padding:24px}.sheet{background:white;color:#111;padding:14mm;width:100%;min-height:260mm;font-size:12px}.sheet-head{display:flex;justify-content:space-between;border-bottom:2px solid #174b3f;padding-bottom:18px;margin-bottom:20px}.sheet-head h1{font-size:25px}.sheet-head p{color:#222;margin:4px 0;font-size:12px}.sheet-title{text-align:right}.sheet-title h2{font-size:26px;letter-spacing:6px}.sheet .sheet-meta{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:20px;line-height:1.7}.sheet table{font-size:12px}.sheet th,.sheet td{border:1px solid #555;padding:7px;color:#111}.sheet th{background:#f3f3f3}.sheet tfoot th{text-align:right}.sheet-notes{white-space:pre-wrap;overflow-wrap:anywhere;min-height:65px;margin:18px 0;font-size:12px}.sheet-foot{margin-top:30px;padding-top:18px;border-top:1px solid #aaa;line-height:2;white-space:pre-wrap;overflow-wrap:anywhere}.sheet-sign{display:flex;justify-content:space-between;margin-top:35px;gap:20px}.print-only{display:none}.text-wrap{white-space:pre-wrap;overflow-wrap:anywhere}.subtle{color:var(--muted)}
@media(max-width:1100px){.sidebar{width:190px;padding:24px 14px}.main-shell{margin-left:190px}#app{padding:24px}.topbar,.test-strip{padding-left:24px;padding-right:24px}.stats{grid-template-columns:repeat(2,1fr)}.onboarding{gap:10px}.step{padding:16px}.hero .number-mark{display:none}}
@media(max-width:720px){.sidebar{position:static;width:auto;padding:16px}.brand{font-size:17px}.brand-symbol{font-size:28px}.workspace-label,.sidebar-bottom{display:none}nav{display:flex;overflow:auto;margin-top:18px;gap:5px}nav button{padding:9px;font-size:13px}nav button span{display:none}.main-shell{margin:0}.topbar{height:60px;padding:0 16px}.user-menu{gap:6px}.test-strip{padding:10px 16px}#app{padding:20px 14px}.page-heading{align-items:flex-start}h1{font-size:25px}.page-heading p{font-size:12px}.stats{gap:9px}.stat{padding:16px}.stat strong{font-size:24px}.hero{padding:24px}.hero h1{font-size:24px}.onboarding{grid-template-columns:1fr}.step .step-num{margin-bottom:6px}.card{padding:18px}.grid.three,.grid.two,.totals-row{grid-template-columns:1fr}.totals-row{gap:18px}.sticky-actions{flex-wrap:wrap}.auth-card{padding:28px}dialog{padding:20px}.sheet{padding:18px}.sheet-head{flex-wrap:wrap}.sheet-title{text-align:left}.sheet .sheet-meta{grid-template-columns:1fr}.print-actions{font-size:12px}}
@page{size:A4;margin:12mm}
@media print{body{background:white!important}.no-print,dialog{display:none!important}.print-only{display:block}.sheet{padding:0;min-height:0;width:auto}.sheet th,.sheet td{color:black;border-color:black;overflow-wrap:anywhere}.sheet tr{break-inside:avoid}.sheet thead{display:table-header-group}.sheet tfoot{display:table-row-group}.sheet-head,.sheet-foot,.sheet-sign{break-inside:avoid}a{color:black}.sheet .sheet-meta{grid-template-columns:1fr 1fr}*{-webkit-print-color-adjust:exact;print-color-adjust:exact}}

/* 熟悉版面：沿用原簽單系統的上方工具列、主表單與右側查詢配置 */
body{background:#eef1f5}.panel{background:#fff;border:1px solid #dde3ea;border-radius:8px;box-shadow:0 8px 26px rgba(0,0,0,.06);padding:18px}.legacy-header{width:calc(100% - 36px);max-width:1444px;margin:18px auto 0}.legacy-brand-row{display:flex;justify-content:space-between;align-items:center;gap:24px}.legacy-brand-row h1{font-size:31px;letter-spacing:2px;margin:0 0 5px;color:#111}.legacy-brand-row p{margin:3px 0;color:#667085;line-height:1.5}.legacy-brand-row .legacy-contact{font-size:17px;color:#111}.legacy-status{display:inline-flex;align-items:center;padding:5px 10px;border-radius:999px;background:#e8f7ee;color:#106b35!important;font-size:13px;font-weight:800}.legacy-custom-note{min-width:260px;border:1px solid var(--line);background:var(--light);padding:16px 18px;border-radius:10px;display:grid;gap:5px;color:var(--ink)}.legacy-custom-note span{font-size:12px;color:var(--muted)}.legacy-toolbar{display:flex;gap:9px;flex-wrap:wrap;align-items:center;margin-top:16px}.legacy-toolbar form{margin:0}.legacy-toolbar button,.legacy-link{border:0;border-radius:8px;background:var(--green);color:#fff;padding:10px 15px;font-weight:800;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;text-decoration:none;line-height:1.2}.legacy-toolbar .secondary,.secondary{background:#f3f5f8;color:#111;border:1px solid #d6dde6}.legacy-toolbar .green,.green{background:#16a34a;color:#fff;border-color:#16a34a}.legacy-toolbar button:hover,.legacy-link:hover{border-color:var(--green);background:var(--light);color:var(--ink)}.current-user{display:inline-flex;align-items:center;padding:8px 12px;border-radius:999px;background:#e8f7ee;color:#106b35;font-weight:800}.main-shell{margin-left:0}.legacy-subbar{max-width:1444px;margin:0 auto;padding:12px 18px 0;display:flex;justify-content:space-between;align-items:center;color:#667085;font-weight:700}.test-strip{max-width:1444px;margin:10px auto 0;border:1px solid #eee0b7;border-radius:8px;padding:9px 14px;background:#fffaf0}#app{max-width:1480px;margin:0 auto;padding:18px}.page-heading{margin:0 0 14px;padding:18px;background:#fff;border:1px solid #dde3ea;border-radius:8px;box-shadow:0 8px 26px rgba(0,0,0,.04)}.page-heading .eyebrow{display:none}.page-heading h1{font-size:31px;letter-spacing:2px;margin-bottom:7px;color:#111}.page-heading p{color:#667085}.legacy-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:16px;align-items:start}.legacy-form-panel{min-width:0}.legacy-section{border-radius:8px;padding:18px;margin-bottom:16px;box-shadow:0 8px 26px rgba(0,0,0,.04)}.legacy-section h2,.legacy-history-panel h2{font-size:18px;margin:0 0 14px;border-left:5px solid var(--green);padding-left:9px;color:#111}.legacy-basic-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.legacy-customer-grid{grid-template-columns:repeat(5,minmax(0,1fr));margin-top:14px}.legacy-customer-grid label:nth-child(7){grid-column:1/-1}.legacy-entry-table{border-collapse:collapse;background:#fff}.legacy-entry-table th,.legacy-entry-table td{border:1px solid #dfe4ea}.legacy-entry-table th{background:#f5f6f8;color:#111;text-align:left}.legacy-entry-table td:first-child,.legacy-entry-table th:first-child{text-align:center}.legacy-history-panel{position:sticky;top:12px;padding:18px;max-height:calc(100vh - 24px);overflow:auto;margin:0}.legacy-history-list{display:grid;gap:9px;margin:12px 0 18px}.legacy-order-card{border:1px solid #dfe4ea;border-radius:8px;padding:11px;display:grid;gap:7px;background:#fff}.legacy-order-card strong{line-height:1.45;color:#111}.legacy-order-card span{font-size:12px;color:#667085}.legacy-order-card div{display:flex;gap:7px}.legacy-history-panel hr{border:0;border-top:1px solid #dfe4ea;margin:18px 0}.full-width{width:100%;justify-content:center;margin-bottom:8px}.inline-actions{display:flex;gap:8px;flex-wrap:wrap}.sticky-actions{border:1px solid #dde3ea;border-radius:8px;background:#fff;box-shadow:0 8px 26px rgba(0,0,0,.06)}
@media(max-width:1180px){.legacy-layout{grid-template-columns:1fr}.legacy-history-panel{position:static;max-height:none}.legacy-customer-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){.legacy-header{width:calc(100% - 20px);margin-top:10px;padding:14px}.legacy-brand-row{align-items:flex-start}.legacy-custom-note{display:none}.legacy-toolbar>*{flex:1 1 145px}.legacy-toolbar .current-user{flex:0 0 auto}.legacy-basic-grid,.legacy-customer-grid{grid-template-columns:1fr}.legacy-customer-grid label:nth-child(7){grid-column:auto}.legacy-subbar{padding:10px 10px 0}.test-strip{margin:8px 10px 0}.page-heading{padding:14px}.page-heading h1{font-size:26px}}
