/* Abadiy POS popup, based on the user's terminal reference. */
#modal.functions-dialog{width:min(1220px,94vw);border-radius:10px;background:#f8fcfd;max-height:92dvh}
#modal.functions-dialog>header{background:#fff;border-bottom:1px solid #d9e5ec;padding:18px 26px}
#modal.functions-dialog #modal-content{padding:22px 26px;max-height:calc(92dvh - 95px)}
.tools-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
.tool-tile{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;min-height:112px;padding:18px 12px;background:linear-gradient(#fafdff,#e9f3f8);border:1px solid #cbdde9;border-radius:8px;color:#29425c;text-align:center;box-shadow:0 2px 0 #dbe6ed;cursor:pointer;font:inherit;touch-action:manipulation}
.tool-tile b{font-size:15px;font-weight:650;line-height:1.4}
.tool-tile small{font-size:11px;line-height:1.35;color:#5d7183;max-width:190px}
.tool-tile:hover:not(:disabled){background:#deedf5;border-color:#88aec5;transform:translateY(-1px)}
.tool-tile:active:not(:disabled){transform:translateY(1px);box-shadow:none}
.tool-tile:focus-visible{outline:3px solid #137f9d;outline-offset:3px}
.tool-tile:disabled{background:#edf1f3;border:1px dashed #bbc6ce;box-shadow:none;color:#75838e;cursor:not-allowed}
.tool-tile:disabled small{color:#697781}
.tools-close{display:flex;justify-content:center;padding:50px 0 4px}
.tools-close button{min-width:185px;min-height:60px;font-size:16px;border-radius:7px}
.tool-success{padding:20px;border:1px solid #b6daca;background:#edf8f1;border-radius:8px;color:#176240;font-weight:650}
.tool-details{display:grid;grid-template-columns:1fr 1fr;gap:0;margin:20px 0}
.tool-details dt,.tool-details dd{padding:12px 0;margin:0;border-bottom:1px solid #dce6ed}
.tool-details dd{text-align:right;font-weight:650}
.tool-search{display:flex;align-items:center;gap:12px}.tool-search input{margin:0!important;flex:1}.tool-search button{min-height:51px}
.lookup-results{display:grid;gap:12px}.lookup-card{display:flex;align-items:center;gap:18px;padding:16px;background:#f4f8fa;border:1px solid #dce6ed;border-radius:8px}
.lookup-card img{width:72px;height:72px;object-fit:contain;border-radius:6px}.lookup-card>div{flex:1;min-width:0}.lookup-card small{display:block;font-size:12px;color:#6b7d8c;margin-top:6px}.lookup-card strong{white-space:nowrap}
#modal-content .tool-checkbox{display:flex;align-items:center;gap:12px;font-size:15px}#modal-content select{display:block;width:100%;padding:14px;margin-top:8px;border:1px solid #cfdce6;border-radius:7px;background:#fff;color:#27435a;font:inherit}
@media(max-width:1000px){.tools-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.tools-close{padding-top:25px}.tool-tile{min-height:100px}.tool-tile b{font-size:13px}}
@media(max-width:600px){.tools-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}#modal.functions-dialog #modal-content{padding:16px}.tool-tile{padding:12px 8px}.tool-tile small{font-size:10px}.lookup-card{flex-wrap:wrap;gap:12px}.lookup-card img{width:50px;height:50px}.lookup-card>div{flex-basis:60%}.tool-search{flex-wrap:wrap}.tool-search button{width:100%}}
@media print{#print-receipt{width:var(--abadiy-pos-paper-width,72mm)!important}#print-receipt h2{font-size:15px;text-align:center}}
.printer-profiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:14px 0}.printer-profiles label{margin:0!important}.printer-profiles select{display:block;width:100%;margin-top:7px;padding:12px;border:1px solid #cfdae4;border-radius:7px;background:#fff}
.debt-list,.receiving-list{display:grid;gap:10px}.debt-card,.receiving-card{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:16px;padding:14px 16px;border:1px solid #dbe5ed;border-radius:9px;background:#f9fbfc}.debt-card div:first-child,.receiving-card div{display:grid;gap:3px}.debt-card span,.debt-card small,.receiving-card small{color:#718496}.debt-card div:nth-child(2){text-align:right}.debt-card strong{font-size:19px;color:#263f5a}.debt-actions,.receiving-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:16px}.receiving-head span{font-size:12px;color:#718496}
.receiving-meta{display:grid;grid-template-columns:1fr 1fr;gap:14px}.receiving-search{position:relative;margin:14px 0}.receiving-search>input{margin:0!important}.receiving-search>div{position:absolute;z-index:3;left:0;right:0;top:100%;background:#fff;border:1px solid #dbe5ed;box-shadow:0 12px 30px rgb(0 0 0 / 12%);max-height:260px;overflow:auto}.receiving-search button{display:flex;width:100%;justify-content:space-between;gap:12px;padding:10px 12px;border:0;border-bottom:1px solid #edf1f4;background:#fff;text-align:left}.receiving-search button:hover{background:#f2f7fa}.receiving-search button small{color:#718496}
.receiving-table{width:100%;border-collapse:collapse;margin-top:14px}.receiving-table th,.receiving-table td{padding:9px;border-bottom:1px solid #e3eaf0;text-align:left}.receiving-table input[type=number]{min-width:100px;margin:0!important;padding:9px!important}.receiving-table input[type=checkbox]{width:20px;height:20px}.receiving-table button[data-remove-line]{border:0;background:#f7dbe4;color:#a32d53;border-radius:6px;font-size:20px}.receiving-applied{display:grid;gap:8px;margin:16px 0}.receiving-applied p{display:flex;justify-content:space-between;margin:0;padding:10px 12px;background:#f3f7f8;border-radius:7px}
@media(max-width:800px){.printer-profiles,.receiving-meta{grid-template-columns:1fr}.debt-card,.receiving-card{grid-template-columns:1fr}.debt-card div:nth-child(2){text-align:left}.debt-actions,.receiving-head{align-items:flex-start;flex-direction:column}.receiving-table{font-size:11px}.receiving-table th,.receiving-table td{padding:6px}}

/* Abadiy POS debtor registry */
dialog.debtor-dialog{width:min(1240px,calc(100vw - 36px));height:min(820px,calc(100dvh - 36px))}
dialog.debtor-dialog #modal-content{height:calc(100% - 92px);max-height:none;padding:0;overflow:hidden}
.debtor-page{height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto;background:#f8fbfd}
.debtor-toolbar{display:flex;gap:12px;padding:16px 20px;border-bottom:1px solid #dce5ec;background:#fff}.debtor-toolbar form{display:flex;gap:8px;flex:1}.debtor-toolbar input{margin:0!important;min-width:280px;flex:1}.debtor-toolbar button{white-space:nowrap}
.debtor-table-wrap{overflow:auto;background:#fff}.debtor-table{width:100%;border-collapse:collapse;table-layout:fixed}.debtor-table th{position:sticky;top:0;z-index:2;background:#d9eff9;color:#304d67;padding:14px 16px;text-align:left;font-size:14px;font-weight:600}.debtor-table td{padding:15px 16px;border-bottom:1px solid #e3eaf0;font-size:16px}.debtor-table td:nth-child(3){font-variant-numeric:tabular-nums}.debtor-table tr{cursor:pointer}.debtor-table tbody tr:hover td{background:#eff8fb}.debtor-table tbody tr.selected td{background:#dff3f6}.debtor-table tbody tr.selected td:first-child{box-shadow:inset 4px 0 #16aaba}
.debtor-sale-panel{display:grid;grid-template-columns:1fr 1fr 1fr auto;gap:16px;align-items:center;padding:20px;background:linear-gradient(105deg,#e9f3f8,#d9e7f0);border-top:1px solid #cddbe5}.debtor-sale-panel>div:not(.debtor-panel-actions){display:grid;grid-template-columns:1fr auto;gap:18px;align-items:center;background:#f8fbfc;border:1px solid #dce7ed;border-radius:8px;padding:14px 16px;min-height:76px}.debtor-sale-panel span{color:#607387;font-size:13px;line-height:1.35}.debtor-sale-panel strong{font-size:20px;color:#253f5a;text-align:right}.debtor-panel-actions{display:flex;gap:9px}.debtor-panel-actions button{min-height:62px}
.debtor-create{height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;padding:24px 28px}.debtor-create-fields{display:grid;grid-template-columns:1fr 1fr 220px;gap:18px}.debtor-create-fields label{margin:0!important}.debtor-create-fields input{font-size:20px!important}
.touch-keyboard{align-self:center;padding:12px 0}.text-keyboard{display:grid;gap:7px}.text-keyboard>div{display:flex;justify-content:center;gap:7px}.text-keyboard button,.phone-keypad button{background:#11b5c5;color:#fff;border-radius:7px;min-width:55px;min-height:58px;font-size:19px;box-shadow:0 1px 2px #0d506020}.keyboard-bottom button:first-child{min-width:310px}.phone-keypad{display:grid;grid-template-columns:repeat(3,80px);gap:8px;justify-content:center}.phone-keypad button{min-width:80px;min-height:70px;font-size:24px}.debtor-create-actions{justify-content:center!important}.debtor-create-actions button{min-width:220px}
.debtor-card-head{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 20px;background:#eff6f8;border-radius:10px;margin-bottom:18px}.debtor-card-head>div{display:grid;gap:5px}.debtor-card-head b{font-size:22px}.debtor-card-head span{color:#738697}.debtor-card-head>strong{font-size:28px;color:#274b66}
.debtor-orders{width:100%;border-collapse:collapse}.debtor-orders th,.debtor-orders td{padding:12px;border-bottom:1px solid #e3eaf0;text-align:left}.debtor-orders th{background:#e8f3f7}.debt-amount-pad{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.debt-amount-pad button{padding:13px;background:#e8f1f6;color:#34546d;border-radius:7px}
@media(max-width:900px){.debtor-sale-panel{grid-template-columns:1fr 1fr}.debtor-panel-actions{grid-column:1/-1}.debtor-create-fields{grid-template-columns:1fr}.text-keyboard button{min-width:38px;min-height:48px}.keyboard-bottom button:first-child{min-width:220px}}

/* Quick receiving header */
.quick-receiving-form{max-width:700px;margin:0 auto;display:grid;gap:14px;padding:4px 8px}
.quick-receiving-form>label{display:grid;grid-template-columns:130px minmax(0,1fr);gap:14px;align-items:center;margin:0!important}
.quick-receiving-form input,.quick-receiving-form textarea{margin:0!important}
.quick-receiving-amount input{font-size:28px!important;text-align:center!important;border:2px solid #62bdc8!important}
.quick-receiving-datetime{display:grid;grid-template-columns:1.2fr 1fr;gap:10px}
.quick-supplier-field{display:grid;grid-template-columns:1fr 52px;gap:6px}
.quick-supplier-field button{border-radius:6px;background:#e7eef4;color:#314d66;font-size:22px}
.quick-receiving-check{grid-template-columns:130px 1fr!important}.quick-receiving-check input{width:22px;height:22px}
.quick-receiving-actions{display:grid;grid-template-columns:1fr 1fr 1.25fr;gap:10px;margin-top:8px}
.quick-receiving-actions button{min-height:58px;border-radius:6px}
.quick-supplier-pad{border-top:1px solid #e1e8ed;padding-top:12px}
.supplier-keyboard{display:grid;gap:6px}.supplier-keyboard>div{display:flex;justify-content:center;gap:5px}
.supplier-keyboard button{min-width:42px;min-height:46px;border-radius:5px;background:#12b5c5;color:#fff}
.supplier-keyboard button[data-supplier-space]{min-width:220px}
.supplier-keyboard button[data-supplier-layout]{background:#eef3f6;color:#38536a;border:1px solid #dce5eb}
.receiving-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:14px}
.receiving-summary span{display:grid;gap:4px;background:#f2f7f9;border-radius:7px;padding:11px}
.receiving-summary small{color:#7a8b98}.receiving-summary b{color:#284a62}
@media(max-width:700px){.quick-receiving-form>label{grid-template-columns:1fr}.quick-receiving-actions{grid-template-columns:1fr 1fr}.quick-receiving-actions .primary{grid-column:1/-1}.receiving-summary{grid-template-columns:1fr}.supplier-keyboard button{min-width:34px}}

/* Stock forms reuse the Abadiy controls and modal hierarchy. */
.stock-document-row{display:flex;align-items:center;gap:16px;padding:14px 0;border-bottom:1px solid var(--line,#deded8)}
.stock-document-row>div{flex:1;min-width:0}.stock-document-row small,.stock-table small{display:block;margin-top:4px;color:var(--muted,#595d55);overflow-wrap:anywhere}
.stock-document-row b{overflow-wrap:anywhere}.stock-table-wrap{overflow:auto;margin-block:16px}.stock-table{border-collapse:collapse;width:100%;font-variant-numeric:tabular-nums}.stock-table th,.stock-table td{text-align:left;padding:10px 8px;border-bottom:1px solid var(--line,#deded8)}.stock-table th{font-size:13px}.stock-table td:first-child{min-width:140px}.stock-table input{width:100%;min-width:70px;max-width:150px}.stock-applied p{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;border-bottom:1px solid var(--line,#deded8);padding-bottom:10px}.stock-sync-confirm{display:flex!important;align-items:center;gap:12px}.stock-sync-confirm input{width:auto!important}.stock-create button{flex:1}#stock-form details{margin-top:18px}#stock-form details p{font-size:13px;overflow-wrap:anywhere}#stock-search{width:100%}#stock-suggestions{max-height:230px;overflow:auto;display:flex;flex-direction:column;gap:4px}#stock-suggestions button{text-align:left}.stock-list{margin-block:16px}
@media(max-width:520px){.stock-document-row{gap:8px}.stock-table th,.stock-table td{padding:8px 4px}.stock-table td:first-child{min-width:110px}.stock-table input{min-width:60px}.stock-create{flex-direction:column}}
