/* Counter Sales only. B2B and eOrders keep their own desk layout. */
.se-counter-entry,.sr-return-entry:not(.se-wholesale,.sr-wholesale-return){
  --counter-head:#244b92;--counter-action:#0ca1f6;--counter-return:#c75961;--counter-rail:#eaf4ff;
}
.se-counter-entry .se-prescription-tools{height:30px;display:inline-flex;position:relative;align-items:center;border:1px solid #ccc;background:#fff;flex:none}
.se-counter-entry .se-prescription-tools button{width:34px;height:28px;display:grid;place-items:center;background:transparent;color:#4b9ee0;border:0;padding:0}
.se-counter-entry .se-prescription-tools button:first-child{border-right:1px solid #d3dae2}
.se-counter-entry .se-prescription-tools button:hover{background:#e8f4ff}
.se-counter-entry .se-prescription-tools button[data-rx-count]{position:absolute;top:-7px;right:-4px;width:18px;height:18px;border-radius:50%;background:#044c9d;color:white;font-size:11px}
.se-counter-entry .se-customer-strip .se-date,.se-counter-entry .se-footer{background:var(--counter-head)}
.se-counter-entry .se-data-freshness{min-height:30px;margin:0;background:#fff9e9;border:0;border-left:2px solid #e5ba6a;padding:6px 12px}
.se-counter-entry .se-lines,.sr-return-entry:not(.se-wholesale,.sr-wholesale-return) .se-lines{background:linear-gradient(to left,var(--counter-rail) 150px,#fff 150px)}
.se-counter-entry .se-empty-fill{display:flex;justify-content:center;align-items:flex-start;min-height:250px;padding:50px 10px 24px}
.se-counter-entry .se-empty-fill img{display:block;width:min(294px,100%);height:auto;aspect-ratio:294/220}
.se-counter-entry .se-lines:not(:has(.se-data-freshness:not([hidden]))) .se-empty-fill{padding-top:79px}
.se-counter-entry #se-settings svg{transition:transform .25s ease}
.se-counter-entry #se-settings:hover svg,.se-counter-entry #se-settings:focus-visible svg{transform:rotate(40deg)}
.se-counter-entry #se-settings,.se-counter-entry #se-save,.se-counter-entry .se-save-toggle{background:var(--counter-action)}
.se-counter-entry .se-save-toggle{filter:brightness(.93)}
.se-counter-entry .se-order,.se-counter-entry .se-order select{width:173px}
.se-counter-entry .se-save-group details .se-menu{min-width:215px}
.se-counter-entry .se-save-group .se-menu button{font-weight:500}
.se-counter-entry .se-head .se-item{gap:8px}
.se-counter-entry .se-clear-doctor:not(:focus-visible){opacity:.8}
.sr-return-entry:not(.se-wholesale,.sr-wholesale-return) .se-footer,
.sr-return-entry:not(.se-wholesale,.sr-wholesale-return) .se-customer-strip .se-date{background:var(--counter-return)}
.manual-return-entry:not(.se-wholesale) .se-customer .se-field{min-width:0}
.manual-return-entry:not(.se-wholesale) .se-search-row{width:100%;padding-left:20px}
.manual-return-entry .se-search-row .manual-return-search{width:min(648px,100%);margin-left:0}
.manual-return-search>input{min-width:0}

@media(min-width:1251px){
  .se-counter-entry:not(.se-financial-edit) .se-customer-strip{grid-template-columns:19% 37.15% 15.85% 28%}
  .se-counter-entry:not(.se-financial-edit) .se-customer-strip>div{padding-block:8px}
  .se-counter-entry .se-top-actions,.sr-return-entry:not(.se-wholesale,.sr-wholesale-return) .se-top-actions{transform:translateY(2px)}
  .se-counter-entry .se-top-actions :is(.se-staff,.se-staff select,.se-payment,.se-reminder){width:140px;min-width:140px}
  .se-counter-entry .se-payment .pay-picker{width:100%}
  .se-counter-entry .se-search-wrap{width:min(722px,53%)}
  .se-counter-entry .se-search-row{height:43px}
  .se-counter-entry .se-search-wrap{height:43px}
  .manual-return-entry:not(.se-wholesale):not(.se-financial-edit) .se-customer-strip{grid-template-columns:19% 34.15% 18.43% 28.42%;height:63px}
  .manual-return-entry:not(.se-wholesale) .se-customer-strip>div{padding-block:8px}
}

/* Keep the search and microphone reachable on phones even when the item grid
   must scroll. The data columns keep their desktop order and widths. */
@media(max-width:900px){
  .se-counter-entry .se-lines,.sr-return-entry:not(.se-wholesale,.sr-wholesale-return) .se-lines{background:white}
  .se-counter-entry .se-head,.se-counter-entry .return-head{scroll-margin-left:0}
  .se-counter-entry .se-search-row,.manual-return-entry:not(.se-wholesale) .se-search-row{min-width:0;width:100%;position:sticky;left:0}
  .se-counter-entry .se-search-row .se-search-wrap,.manual-return-entry .se-search-row .manual-return-search{width:auto;flex:1;min-width:0;margin-inline:10px}
  .manual-return-entry:not(.se-wholesale) .se-search-row{padding-inline:0}
  .se-counter-entry .se-history-action{white-space:nowrap;margin-right:6px}
  .se-counter-entry .se-top-actions{margin-left:0}
}

/* Register chrome: the desktop widths match the live filter strip. */
@media(min-width:1280px){
  .sales-register-v2:not(.trade-workspace) .sales-search-group{flex:0 0 350px}
  .sales-register-v2:not(.trade-workspace) .sales-range{flex:0 0 230px}
  .sales-register-v2:not(.trade-workspace) .sales-mobile-filter{flex:0 0 230px}
}
.sales-register-v2 .sales-register-filters{padding-top:16px;min-height:51px}
.sales-register-v2 .sales-register-table [aria-sort]:not([aria-sort=none]) .sales-sort{color:#4b9ee0}
.return-register .sales-history-title>a:not(.sales-new),.return-register .sales-history-title h1{font-size:16px;font-weight:700}
.sales-register-v2 .sales-icon-btn:hover,.sales-register-v2 .sales-return-link:hover{color:#087ec3}
.sales-register-v2 :is(.sales-new,.sales-more-filter,.sales-search-group button):hover{filter:brightness(.95)}
.sales-register-v2 [data-sr-bill]:focus-visible,.sales-register-v2 [data-rr-open]:focus-visible{outline:2px solid #42a5f5;outline-offset:-2px}
.return-register .return-empty .return-empty-art{width:137px;height:108px;object-fit:contain;margin:0 auto 13px;display:block}

/* Reference sheets dock at the bottom without overflowing a small viewport. */
.modal:has(.sales-settings-sheet,.sale-metadata-sheet,.bill-edit-choice,.return-edit-choice,.return-log-history,.return-sales-history,.sales-log-sheet){
  align-items:flex-end;padding:0;z-index:60;
}
.modal>.sales-settings-sheet{width:min(600px,100%);min-height:min(279px,90dvh);margin:0;border-radius:4px 4px 0 0!important}
.modal>.sales-settings-sheet>header{height:60px;padding:10px 20px;background:#044c9d}
.sales-settings-sheet>header h2{font:600 24px/28px Manrope,Arial,sans-serif}
.sales-settings-sheet>header button[type=submit]{border:0;border-radius:2px;background:#0ca1f6;min-width:68px;padding:4px 12px;font:600 14px/22px Manrope,Arial,sans-serif}
.sales-settings-sheet form{padding:20px;min-height:195px}
.sales-settings-sheet form>p{margin:8px 0 0;color:#5e7289;font-size:13px}
.sales-settings-order{border:0;padding:0;margin:0 0 18px;display:flex;align-items:center;gap:12px;color:#044c9d}
.sales-settings-order legend{float:left;min-width:112px}
.sales-settings-order label{display:inline-flex;align-items:center;gap:6px;margin:0}
.sales-settings-order input{width:16px;height:16px;accent-color:#0ca1f6;margin:0}
.sales-settings-source{display:grid;grid-template-columns:112px minmax(0,248px);align-items:center;color:#044c9d}
.sales-settings-source label{margin:0;color:inherit}
.sales-settings-source select{font:14px/20px Manrope,Arial,sans-serif;border:1px solid #c9d3df;background:#fff;color:#044c9d;border-radius:0;height:31px;padding:4px 9px}
.sales-settings-tools{margin-top:17px;color:#1c74b0;font-size:13px}
.sales-settings-tools summary{cursor:pointer}
.sales-settings-tools>div{display:flex;flex-wrap:wrap;gap:8px;margin-top:9px}
.sales-settings-tools button{border:1px solid #cfdfec;color:#044c9d;background:white;font:13px Manrope,Arial,sans-serif;padding:5px 9px}
.sales-settings-tools button:disabled{color:#718398}
.modal>.bill-edit-choice,.modal>.sale-metadata-sheet,.modal>.return-edit-choice,.modal>.return-log-history,.modal>.return-sales-history{max-width:100%;margin:0;border-radius:4px 4px 0 0!important}
.modal>.bill-edit-choice{min-height:min(437px,90dvh)}
.modal>.sale-metadata-sheet{width:min(720px,100%);min-height:min(432px,90dvh)}
.modal>.return-metadata-sheet{min-height:min(413px,90dvh)}
.modal>.return-log-history,.modal>.sales-log-sheet{width:min(900px,100%);min-height:min(410px,90dvh)}
.modal>.return-sales-history{width:min(930px,100%);min-height:min(415px,90dvh)}
.modal>.return-edit-choice{max-height:90dvh;overflow:auto}
.modal>.return-edit-choice>div{grid-template-columns:1fr;gap:18px}
.modal>.return-edit-choice section>button{align-self:flex-start;min-width:78px;padding:5px 20px;background:#0ca1f6}
.modal>.return-edit-choice section>button:disabled{background:#d5dce5;color:#617286}
.return-workspace .bill-more>div[role=menu]{width:158px;min-width:158px;top:100%;padding:0;border-radius:3px;box-shadow:0 2px 10px #0003}
.return-workspace .bill-more>div[role=menu]>button{box-sizing:border-box;min-height:36px;padding:0 14px;gap:10px;border-bottom:1px solid #e7edf3;color:#111}
.return-workspace .bill-more>div[role=menu]>button:focus-visible{background:#eaf5fe;outline:2px solid #8dc8f7;outline-offset:-2px}
.return-workspace .bill-more>div[role=menu]>button:disabled{color:#7c8c9b}
.return-workspace .bill-more>div[role=menu] svg{color:#59a4d5;width:14px;height:14px}
.modal>.sales-rx-sheet{width:min(570px,100%);max-height:90dvh}
.sales-rx-sheet>div{padding:19px;overflow:auto;max-height:calc(90dvh - 51px)}
.sales-rx-sheet ul{list-style:none;margin:10px 0 18px;padding:0}
.sales-rx-sheet li{border-bottom:1px solid #deeaf3;padding:8px 0;display:flex;gap:9px;justify-content:space-between;align-items:center;word-break:break-word}
.sales-rx-sheet li small{margin-left:9px;color:#596e85;white-space:nowrap}
.sales-rx-sheet li button{border:0;background:none;color:#b54557;font-size:22px}
.sales-rx-sheet #sales-rx-error{color:#b54557}.sales-rx-sheet #sales-rx-error:empty{display:none}
.sales-rx-sheet [data-rx-done]{margin-left:8px}
@media(prefers-reduced-motion:reduce){.se-counter-entry #se-settings svg{transition:none;transform:none}}
/* Owner 23 Nov 2026: the top bar's menus (payment type, staff, order type) open above the Billing for / Doctor / customer
   panels. The bar's small translate makes it its own layer, so the whole bar is lifted above the panels below it. */
.se-entry .se-top,.sr-return-entry .se-top{z-index:45}
.se-inline-customer .se-customer-label{gap:7px}
.se-customer-kind{display:flex;flex:none;gap:2px;align-items:center;padding:1px;border:1px solid #d3e3ee;border-radius:5px;background:#f2f8fd}
.se-customer-kind button{appearance:none;border:1px solid transparent;border-radius:3px;background:transparent;color:#1d4c74;min-height:24px;padding:2px 6px;font:700 12px/1.35 Manrope,Arial,sans-serif;cursor:pointer;white-space:nowrap}
.se-customer-kind button[aria-pressed=true]{background:#fff;border-color:#c5dff1;color:#074e87}
.se-customer-kind button:focus-visible,.se-customer-info:focus-visible{outline:2px solid #0a78bc;outline-offset:2px}
.se-inline-customer .se-customer-label :is(#se-customer-label,#se-customer-display-name){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.se-inline-customer #se-customer-display-name{font-weight:700;color:var(--se-blue)}
.se-inline-customer #se-customer-balance{flex:none}
.se-inline-customer #se-customer-info>span{display:inline;min-width:0;overflow:hidden;text-overflow:ellipsis}
.se-counter-entry .se-cart-row.se-key-row{background:#dcefff;box-shadow:inset 0 0 0 2px #1486c4, inset 5px 0 #1486c4}
.se-key-help{display:flex;gap:4px;align-items:center;flex-wrap:wrap;margin:0;padding:4px 10px;color:#52687e;background:#f8fbfe;border-bottom:1px solid #e5edf4;font:650 11px/1.45 Manrope,Arial,sans-serif}
.se-key-help kbd{padding:0 4px;border:1px solid #d8e4f0;border-radius:3px;background:white;color:#254e72;font:inherit}
.se-key-help span{padding:0 3px}
.se-counter-entry:has(#se-search-row[hidden]) .se-key-help{display:none}
.se-crumb .se-last-bill{font-size:12px;color:#12699c;margin-inline-start:8px}

/* New Sales layering: keep the bill body below its field menus and toolbar,
   and keep all of those below the page's dialogs. Let the customer row size
   to its contents (type switch, prompts and account balance can add lines). */
.se-counter-entry{isolation:isolate}
.se-counter-entry .se-customer-strip{position:relative;z-index:34;flex:none}
.se-counter-entry #se-customer-search-row{min-width:0}
.se-counter-entry .se-customer-menu{right:0}
.se-counter-entry .se-family-popover{max-height:min(300px,48dvh);overflow:auto}
.se-counter-entry .se-customer-info b{min-width:0}
.se-counter-entry .se-top-actions{min-width:0;max-width:100%}
.se-counter-entry .se-menu{max-height:min(380px,55dvh);overflow:auto}
.se-counter-entry .se-top-actions .pay-picker-menu{max-height:min(390px,55dvh);overflow:auto}
/* The narrow fixed batch list can cross the customer and toolbar rows. */
.se-counter-entry .se-batch-menu{z-index:46}

@media(max-width:1250px){
  /* Only bill columns pan sideways; keep medicine search at the visible edge. */
  .se-counter-entry #se-search-row{min-width:0;width:100%;position:sticky;left:0;z-index:15}
}
@media(max-width:900px){
  .se-counter-entry{padding-bottom:0}
  .se-counter-entry .se-top-actions{position:relative;overflow:visible;flex-wrap:wrap;justify-content:flex-end;padding:0}
  .se-counter-entry :is(.se-save-group,#se-save-options){position:static}
  .se-counter-entry #se-save-options .se-menu{right:0;top:calc(100% + 4px)}
  .se-counter-entry .se-footer{position:sticky;bottom:0;left:auto;right:auto;flex:none;height:auto;overflow:visible}
  .se-counter-entry #se-search-row{height:auto;min-height:44px}
  .se-counter-entry .se-search-wrap .ms-results{max-width:calc(100vw - 60px)}
  .se-counter-entry .se-batch-menu{
    top:clamp(64px,30dvh,260px);
    max-height:calc(100dvh - clamp(64px,30dvh,260px) - 14px);
  }
}
@media(min-width:621px) and (max-width:900px){
  .se-counter-entry .se-footer{flex-wrap:wrap;justify-content:flex-end}
}
@media(max-width:620px){
  .se-counter-entry .se-top{align-items:stretch}
  .se-counter-entry .se-top-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .se-counter-entry .se-top-actions :is(.se-staff,.se-staff select,.se-payment,.pay-picker,.se-order,.se-order select){width:100%;min-width:0}
  .se-counter-entry .se-prescription-tools,.se-counter-entry .se-save-group{justify-self:start}
  .se-counter-entry .se-save-group{margin:0}
  .se-counter-entry #se-settings{justify-self:end;margin:0}
  .se-counter-entry .se-payment .pay-picker-menu{min-width:0;width:min(215px,calc(100vw - 36px))}
  .se-counter-entry .se-top-actions :is(.se-reminder,.se-split-edit,.se-cancel-bill){min-width:0}
  .se-counter-entry .se-customer-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
  .se-counter-entry .se-customer-strip>:is(.se-date,.se-customer){grid-column:1/-1;min-height:0;border-right:0}
  .se-counter-entry .se-customer-strip>:is(.se-billing-for,.se-doctor){min-height:54px}
  .se-counter-entry .se-customer-strip .se-date{padding-block:6px}
  .se-counter-entry .se-customer-input-row{flex-wrap:wrap}
  .se-counter-entry .se-customer-input-row input{flex:1 1 112px}
  .se-counter-entry #se-counter{display:inline-flex;align-items:center}
  .se-counter-entry #se-customer-label{white-space:normal}
  .se-counter-entry .se-customer-info{gap:5px;flex-wrap:wrap;white-space:normal}
  .se-counter-entry .se-customer-info>b{max-width:none}
  .se-counter-entry #se-history{font-size:11px!important;padding:4px 5px;gap:4px}
  .se-counter-entry .se-footer{grid-template-columns:minmax(0,1fr) minmax(0,.75fr) minmax(0,1.2fr)}
  .se-counter-entry .se-footer .se-net{justify-content:space-between}
  .se-counter-entry .se-footer #se-change{height:28px;justify-content:center}
}
