:root{font-family:Arial,"Segoe UI",sans-serif;color:#162334;background:#f8fafc;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button{cursor:pointer}header.top{background:#16a34a;color:white;padding:13px 24px 12px}header h1{margin:0 0 5px;font-size:23px}header .sub{font-size:13px;color:#ddfbe9;display:flex;justify-content:space-between;align-items:center;gap:10px}button{background:#16a34a;color:#fff;border:0;border-radius:8px;padding:10px 14px;font-weight:700}button:hover{filter:brightness(.94)}button.alt{color:#117c38;background:white;border:1px solid #b7d3c0}button.blue{background:#2563eb}button.danger{background:#dc2626}button.grey{background:#65758d}.tabs-wrap{background:#eef2f7;border-bottom:1px solid #d8e1eb;padding:10px 15px}.tabs{display:flex;gap:8px;overflow-x:auto;scrollbar-width:thin}.tabs button{flex:none;color:#15803d;background:#fff;border:1px solid #cbd5e1;border-radius:11px;padding:11px 15px;font-size:14px}.tabs button.active{background:#16a34a;color:white;border-color:#16a34a}.container{padding:16px;max-width:1620px;margin:auto}.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.card{background:#fff;border:1px solid #e1e8ef;border-radius:12px;box-shadow:0 2px 10px #0f172a06;padding:16px;margin-bottom:12px}.card h2{font-size:18px;color:#0d843c;margin:0 0 12px}.card h3{margin:0 0 12px}.metric{font-size:25px;font-weight:800;letter-spacing:-.4px}.metric.blue{color:#0284c7}.metric.red{color:#ea580c}.metric.green{color:#129744}.muted{color:#64748b;font-size:13px}.toolbar{display:flex;gap:8px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-bottom:14px}.toolbar h2{font-size:21px;margin:0}.form-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-bottom:10px}.form-row.cols3{grid-template-columns:repeat(3,minmax(0,1fr))}.form-row.cols5{grid-template-columns:repeat(5,minmax(0,1fr))}.field{display:flex;flex-direction:column;gap:5px}.field label{font-size:12px;color:#3c4e61;font-weight:700}.field input,.field select,.field textarea{width:100%;border:1px solid #cbd5e1;border-radius:8px;background:white;padding:10px;min-width:0;color:#1e293b}.field textarea{resize:vertical;min-height:67px}table{border-collapse:collapse;width:100%;font-size:14px;white-space:nowrap}th,td{padding:11px 10px;border-bottom:1px solid #e2e8f0;text-align:left}th{background:#edf2f7;font-size:13px;color:#475569}td{vertical-align:middle}td .mini{padding:6px 9px;font-size:12px;margin-right:4px}.table-wrap{overflow-x:auto;border-radius:10px;border:1px solid #e2e8f0}tfoot td{font-weight:800;background:#ecfdf3}.right{text-align:right}.empty{padding:24px;text-align:center;color:#64748b}.status{padding:10px 15px;position:fixed;right:20px;bottom:20px;max-width:480px;z-index:30;border-radius:10px;background:#0f172a;color:#fff;box-shadow:0 8px 30px #0005}.status.bad{background:#b91c1c}.banner{background:#fef3c7;color:#854d0e;border:1px solid #f59e0b;padding:10px 16px;font-size:12px;text-align:center}.login-bg{min-height:100vh;background:linear-gradient(120deg,#e8f7eb 0,#f8fafc 55%);display:flex;align-items:center;justify-content:center;padding:20px}.login{width:410px;max-width:100%;padding:30px}.login h1{font-size:26px;margin:0 0 12px}.login .field{margin:14px 0}.login button{width:100%}.calendar-toolbar{display:flex;justify-content:center;align-items:center;gap:12px;margin-bottom:12px}.calendar-toolbar h2{min-width:240px;text-align:center;margin:0}.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}.weekday{background:#16a34a;color:white;text-align:center;padding:9px 3px;border-radius:6px;font-weight:bold}.day{min-height:94px;background:white;border:1px solid #d5e0ed;border-radius:8px;padding:7px;cursor:pointer;overflow:hidden;font-size:14px}.day:hover{border-color:#16a34a}.day.today{background:#effdf3;border-color:#16a34a}.day.selected{background:#16a34a;color:white}.day .num{font-weight:800;font-size:17px}.day small{font-size:11px;display:block;color:#64748b}.day.selected small{color:#eaffef}.day .money{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#0284c7;margin-top:3px}.day .expense{color:#ea580c}.day.selected .money{color:white}.actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:6px}.table-actions{min-width:130px}.pos-layout{display:grid;grid-template-columns:1.5fr 1fr;gap:12px}.totals{padding:15px;border-radius:12px;background:#f0fdf4;text-align:right}.pill{border-radius:999px;padding:5px 11px;font-size:12px;background:#dcfce7;color:#166534;display:inline-block}.modal{position:fixed;inset:0;background:#0008;z-index:25;display:flex;align-items:center;justify-content:center;padding:20px}.modal .card{max-width:680px;width:100%;max-height:90vh;overflow-y:auto}.title{font-weight:700;color:#0d843c}.s1a{background:#eff6ff;color:#1d4ed8;border-radius:5px;padding:3px 6px;font-size:12px}.s1a.excluded{color:#be123c;background:#fff1f2}.disabled-note{padding:16px;border:1px dashed #9ca3af;background:#f8fafc;border-radius:10px;color:#475569}.small{font-size:12px}.wide{width:100%}.spacer{flex:1}.hidden{display:none!important}@media(max-width:1200px){.form-row{grid-template-columns:repeat(2,minmax(0,1fr))}.grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:750px){header.top{padding:13px}.container{padding:10px}.grid,.grid2,.pos-layout,.form-row,.form-row.cols3,.form-row.cols5{grid-template-columns:1fr}.card{padding:13px}.tabs-wrap{padding:8px}.tabs button{padding:9px 10px}.day{min-height:70px;padding:4px;font-size:11px}.day .num{font-size:14px}.day small,.day .money{font-size:9px}.weekday{font-size:11px}.calendar-toolbar h2{min-width:160px;font-size:16px}}@media print{header,.tabs-wrap,.banner,.toolbar button,.actions,.status{display:none}.container{padding:0}.card{break-inside:avoid;box-shadow:none}}
/* v0.2.1 PC fidelity: multi-table financial reports, invoice editor, POS controls. */
.qty-buttons{display:flex;gap:5px;align-items:center;justify-content:center;white-space:nowrap}
.qty-buttons b{min-width:20px;text-align:center}
.pc-modal{position:fixed;inset:0;z-index:5000;background:#102a3db8;padding:5vh 5vw;overflow:auto;display:grid;place-items:start center}
.pc-modal-card{background:#fff;border-radius:12px;padding:20px;max-width:980px;width:100%;box-shadow:0 20px 80px #0002}
.pc-modal-card .table-wrap{overflow:auto}
#invoiceEditorBox{scroll-margin-top:16px}
#invoiceEditorBox textarea{min-height:96px}
#saleHistorySearch{padding:8px;border:1px solid #cbd5e1;border-radius:8px}
.table-wrap{overflow-x:auto}
tfoot td{background:#dcfce7;font-weight:700}
@media(max-width:1100px){.grid2{grid-template-columns:1fr}.form-row.cols5{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media print{header.top,.tabs-wrap,.banner,.pc-modal-card button,.container,#app{visibility:hidden!important}.pc-modal{position:static;background:#fff;padding:0;display:block}.pc-modal-card,.pc-modal-card *{visibility:visible!important;box-shadow:none;border:0}.pc-modal-card{position:absolute;left:0;top:0;width:100%;max-width:none}}
/* PC v0.2.3 cashier: matching the original PC payment panel with suggested notes. */
.pc023-paycard{max-width:480px;justify-self:stretch;background:#f8fafc}
.pc023-paycard h2{font-size:17px}
.pc023-payrow{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0;min-height:33px}
.pc023-payrow>span,.pc023-payrow>label{color:#111827;font-size:14px}
.pc023-payrow>strong{font-size:17px;white-space:nowrap;font-variant-numeric:tabular-nums}
.pc023-payrow input:not([type=radio]),.pc023-payrow select{width:160px;max-width:57%;padding:9px;text-align:right;border:1px solid #cbd5e1;border-radius:8px;background:white}
.pc023-payrow select{text-align:left}
.pc023-payrow .pc023-large{font-size:21px}
.pc023-accent{color:#2563eb}
.pc023-choice{display:flex;align-items:center;gap:6px;cursor:pointer}
.pc023-choice input{accent-color:#2563eb}
.pc023-money-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;background:#e2e8f0;padding:10px;border-radius:10px;margin:12px 0}
.pc023-money-btn{padding:9px 4px;background:white;color:#334155;border:1px solid #cbd5e1;font-size:13px}
.pc023-payment-actions{display:grid;gap:8px;margin-top:15px}
.pc023-payment-actions button{width:100%}
.pc023-stock-calculation{padding:14px 16px;background:#eefaf2;border:1px solid #c0e4c9;border-radius:9px;margin:8px 0 14px;font-size:14px;line-height:1.9}
.pc023-stock-calculation .pc023-accent{color:#0f8f45}
.pc023-error{color:#b91c1c;font-weight:bold}
#inventoryStockForm input[readonly]{background:#e8f3ec;border-color:#72b884;font-weight:700}
@media(max-width:760px){.pc023-paycard{max-width:none}.pc023-payrow input:not([type=radio]){max-width:50%}}

.pc023-receipt-summary{line-height:2;background:#f0fdf4;padding:12px;margin:10px 0;border-radius:8px}

/* v0.2.4: the original PC bottom-of-cart sale operations */
.pc024-cart-actions{display:flex;flex-direction:column;gap:9px;margin:12px 0 4px;padding:12px;background:#f6fff8;border:1px solid #cce8d4;border-radius:10px}
.pc024-sales-summary{font-weight:700;color:#116e32;line-height:1.6}
.pc024-buttons{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
.pc024-buttons button{white-space:nowrap;min-width:104px}
.pc024-buttons button.pc024-main-action{background:#16a34a}
.pc024-buttons button:disabled,#payForm button:disabled{opacity:.55;cursor:not-allowed}
.pc024-row-selectable{cursor:pointer}
.pc024-row-selectable:focus,.pc024-row-selectable.pc024-selected{background:#dff9e9;outline:2px solid #16a34a;outline-offset:-2px}
.pc024-overlay{position:fixed;inset:0;z-index:10020;display:grid;place-items:center;background:#0f172aa6;padding:20px}
.pc024-dialog{width:440px;max-width:100%;background:white;border-radius:14px;padding:22px;box-shadow:0 20px 60px #0004}
.pc024-dialog h2{margin:0 0 10px;color:#0c8341;font-size:20px}
.pc024-dialog p{line-height:1.55}
.pc024-dialog-actions{display:flex;justify-content:flex-end;gap:9px;flex-wrap:wrap}
.pc024-dialog-actions button{min-width:80px}
@media(max-width:760px){.pc024-buttons{justify-content:stretch}.pc024-buttons button{flex:1 1 42%;min-width:0}}
@media print{.pc024-cart-actions,.pc024-overlay{display:none!important}}

/* Web PC STAGING v0.2.5: PC-style invoice form with schedule rows and real edit/delete buttons. */
.pc025-subtabs{display:flex;gap:8px;margin-bottom:14px;border-bottom:1px solid #cbd5e1;padding:0 2px 10px}
.pc025-subtabs button{background:#f5f7fa;color:#176b39;border:1px solid #b7cbbb}
.pc025-subtabs button.active{background:#16a34a;color:white}
#pc025InvoiceEditorSection [hidden],#pc025InvoiceListSection[hidden],#pc025ContractPane[hidden]{display:none!important}
#pc025InvoiceEditorSection .pc025-contract-box{min-width:0;border:1px solid #dce8e0;border-radius:9px;padding:12px;background:#fff}
.pc025-contract-box textarea{width:100%;font-size:13px;min-height:200px;white-space:pre-wrap;border:1px solid #cbd5e1;border-radius:6px;padding:10px;resize:vertical}
.pc025-contract-box .table-wrap{margin-top:10px}
.pc025-invoice-totals{border:1px solid #b0dfc2;background:#f0fdf4;padding:15px;border-radius:9px;line-height:2.3;margin:13px 0;font-size:14px}
.pc025-invoice-actions{margin:10px 0 16px}
.pc025-detail-cell{white-space:normal;min-width:150px;max-width:280px;display:block}
#pc025InvoiceLineForm{background:#f8fafc;border:1px solid #e2e8f0;padding:14px;border-radius:9px}
#pc025InvoiceEditorSection hr{border:0;border-top:1px solid #e2e8f0;margin:18px 0}
#pc025InvoiceEditorSection .card h3{margin:15px 0 9px}
#pc025InvoiceEditorSection .actions .alt{color:#166534}
@media (max-width:780px){.pc025-subtabs{flex-wrap:wrap}.pc025-subtabs button{flex:1}.pc025-invoice-actions button{flex:1}}
/* v0.2.6 — ngày lịch mở cửa sổ Thu chi kiểu PC; thiết lập mẫu in. */
.pc026-overlay{position:fixed;inset:0;background:#10243cb8;z-index:12000;overflow:auto;display:flex;align-items:flex-start;justify-content:center;padding:3vh 2vw}
.pc026-day-card{background:#fff;border:1px solid #c6d8cc;border-radius:13px;padding:18px 20px;width:min(1170px,100%);max-height:94vh;overflow-y:auto;box-shadow:0 20px 60px #0004}
.pc026-day-card .table-wrap{margin:8px 0 12px;max-height:330px;overflow:auto}
.pc026-day-card .table-wrap tr[ondblclick]{cursor:pointer}
.pc026-day-card .table-wrap tr:hover{background:#eaf9ed}
.pc026-day-card .grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.pc026-new,.pc026-edit-card{padding:12px;border-radius:9px;border:1px solid #d5e6db;margin-top:12px;background:#fbfefc}
.pc026-new h3,.pc026-edit-card h3{color:#16763d;margin:0 0 10px}
.pc026-wrap{white-space:normal;min-width:160px;max-width:300px}
.pc026-settings-terms{width:100%;min-height:260px;border:1px solid #cbd5e1;border-radius:8px;padding:12px;resize:vertical;font-size:13px;line-height:1.6}
.calendar-grid .day:focus{outline:2px solid #16a34a;outline-offset:0}
@media(max-width:800px){.pc026-day-card .grid{grid-template-columns:1fr}.pc026-day-card{padding:12px}.pc026-overlay{padding:8px}}

/* v0.2.7: Upcoming appointments directly below Today's schedule. */
.pc027-calendar-stack{display:flex;flex-direction:column;gap:12px;min-width:0}
.pc027-calendar-stack>.card{margin-bottom:0}
.pc027-dashboard-bottom>.card{align-self:start}
.pc027-calendar-stack .table-wrap{max-height:410px;overflow:auto}
@media(max-width:1100px){.pc027-dashboard-bottom{grid-template-columns:1fr}}

.calendar-job{font-size:12px;color:#1d4ed8;background:#dbeafe;border-radius:4px;margin-top:3px;padding:3px 4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.calendar-job.done{color:#166534;background:#dcfce7}.day.selected .calendar-job{color:#1d4ed8}.day.selected .calendar-job.done{color:#166534}

/* FIX6C-B FIX1: service scheduling visible before wide detail/price columns. */
#pc025InvoiceLinePanel{background:#f8fafc;border:1px solid #e2e8f0;padding:14px;border-radius:9px;margin-bottom:12px}
#pc025InvoiceLineForm{display:none}
.pc025-service-check{display:inline-flex;align-items:center;gap:6px;cursor:pointer;font-size:13px;font-weight:700;color:#166534;white-space:nowrap}
.pc025-service-check input{width:18px;height:18px;accent-color:#16a34a;margin:0;cursor:pointer;flex:none}
.pc025-paid-field{display:flex;gap:6px;align-items:end;min-width:0}.pc025-paid-field .field{flex:1;min-width:0}.pc025-paid-field button{font-size:12px;padding:10px 7px;white-space:nowrap}
#pc025ContractPane{margin-top:14px}

/* B6D-B2: scoped, responsive native payment dialog, independent from main page refresh. */
.b6d-pay-dialog{box-sizing:border-box;width:min(780px,calc(100% - 20px));max-width:100%;max-height:calc(100% - 24px);padding:0;border:1px solid #cbd5e1;border-radius:12px;background:#f5f7fa;color:#1f2937;overflow:hidden;margin:auto;font:inherit;}
.b6d-pay-dialog[open]{display:flex;flex-direction:column;}
.b6d-pay-dialog::backdrop{background:rgba(15,23,42,.58);}
.b6d-pay-dialog *{box-sizing:border-box;}
.b6d-pay-dialog .b6d-pay-head,.b6d-pay-dialog .b6d-pay-foot{padding:12px 16px;background:#fff;flex:none;}
.b6d-pay-dialog .b6d-pay-head{display:flex;align-items:center;justify-content:space-between;gap:8px;border-bottom:1px solid #dce3ea;color:#15803d;}
.b6d-pay-dialog .b6d-pay-body{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:12px 16px;}
.b6d-pay-dialog h3{margin:0 0 10px;font-size:16px;color:#15803d;overflow-wrap:anywhere;}
.b6d-pay-dialog section{border:1px solid #dce3ea;border-radius:9px;background:#fff;padding:12px;margin:12px 0;}
.b6d-pay-dialog .b6d-pay-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}
.b6d-pay-dialog .b6d-pay-summary>div{background:#fff;padding:9px;border:1px solid #dce3ea;border-radius:8px;overflow-wrap:anywhere;}
.b6d-pay-dialog small{display:block;font-size:12px;color:#64748b;margin-bottom:5px;}
.b6d-pay-dialog .b6d-pay-summary b{font-size:16px;color:#15803d;}
.b6d-pay-dialog .b6d-pay-summary>div:last-child b{color:#c2410c;}
.b6d-pay-dialog label{display:block;font-size:14px;margin:8px 0;}
.b6d-pay-dialog input,.b6d-pay-dialog select{display:block;width:100%;height:auto;min-height:42px;margin-top:5px;border:1px solid #cbd5e1;border-radius:6px;padding:8px;font-size:16px;background:#fff;color:#1f2937;}
.b6d-pay-dialog button{border:1px solid #cbd5e1;background:#fff;color:#1d4ed8;padding:9px;border-radius:6px;font-size:14px;min-height:40px;cursor:pointer;}
.b6d-pay-dialog button:disabled{opacity:.5;cursor:default;}
.b6d-pay-dialog .b6d-pay-primary{width:100%;background:#15803d;color:#fff;border:0;font-weight:600;}
.b6d-pay-dialog .b6d-pay-quick{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;}
.b6d-pay-dialog .b6d-pay-quick [data-b=full]{background:#2563eb;color:white;}
.b6d-pay-dialog .b6d-pay-history{display:grid;grid-template-columns:minmax(120px,1fr) 1fr;gap:8px;border-bottom:1px solid #e2e8f0;padding:8px 0;overflow-wrap:anywhere;}
.b6d-pay-dialog .b6d-pay-foot{font-size:13px;color:#475569;border-top:1px solid #dce3ea;overflow-wrap:anywhere;}
@media(max-width:480px){.b6d-pay-dialog .b6d-pay-body{padding:10px;}.b6d-pay-dialog .b6d-pay-summary>div{padding:6px;}.b6d-pay-dialog .b6d-pay-summary b{font-size:14px;}.b6d-pay-dialog .b6d-pay-history{grid-template-columns:1fr;gap:2px;}.b6d-pay-dialog .b6d-pay-head,.b6d-pay-dialog .b6d-pay-foot{padding:8px 10px;}}

/* B3B FIX1: visibly locked until the existing ledger is opened. */
.b6d-pay-dialog .b6d-pay-open-hint{color:#92400e;background:#fffbeb;border:1px solid #fde68a;border-radius:6px;padding:9px;font-weight:600;}
.b6d-pay-dialog .b6d-pay-locked{color:#64748b;}
.b6d-pay-dialog input[type=checkbox]{display:inline-block;width:20px;height:20px;min-height:0;padding:0;margin:0 5px 0 0;vertical-align:middle;accent-color:#15803d;}
