:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;color:#17323b;background:#edf2f3}
*{box-sizing:border-box}
body{margin:0}
button,input,select{font:inherit}
button{cursor:pointer}
button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #e8a24c;outline-offset:2px}
[hidden]{display:none!important}
.topbar{min-height:66px;background:#12323b;color:white;display:flex;align-items:center;gap:24px;padding:10px 22px}
.brand{display:flex;align-items:center;gap:10px;font-size:1.17rem;font-weight:800;white-space:nowrap}
.brandmark{width:31px;height:31px;border-radius:7px;background:#f2aa54;color:#12323b;display:grid;place-items:center;font-weight:900}
.topbar nav{display:flex;gap:5px}
.tab{background:transparent;color:#c9dbdc;border:0;padding:11px 16px;border-radius:7px;font-weight:750}
.tab.active{background:#28626a;color:white}
.save-status{margin-left:auto;font-size:.8rem;color:#bcd1d2}
main{max-width:1500px;margin:auto}
.view{padding:22px}
.view.narrow{max-width:950px;margin:auto}
.session-strip{display:flex;justify-content:space-between;align-items:center;gap:15px;background:#e0f0ed;border:1px solid #c5dcd8;border-radius:10px;padding:13px 18px;margin-bottom:17px}
.session-strip strong,.session-strip span{display:block}
.session-strip span{font-size:.85rem;color:#557078;margin-top:3px}
.accent,.primary,.secondary{border-radius:8px;padding:11px 15px;font-weight:800;min-height:43px}
.accent{border:0;background:#f2aa54;color:#15343b}
.primary{background:#24666e;color:white;border:0}
.primary:disabled{opacity:.4;cursor:not-allowed}
.secondary{background:white;color:#245f68;border:1px solid #bbd2d6}
.text-button,.back{background:none;border:0;color:#24636b;font-weight:750;padding:9px 4px}
.text-button:hover,.back:hover{text-decoration:underline}
.sell-grid{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:0;border:1px solid #d3e1e3;border-radius:11px;overflow:hidden;box-shadow:0 2px 10px #18343b0a}
.panel{background:white}
.catalog{padding:17px;border-right:1px solid #dbe7e9}
.catalog-head{display:flex;align-items:center;justify-content:space-between}
.catalog h1,.section-head h1{font-size:1.47rem;margin:0 0 12px}
.icon-button{width:36px;height:36px;background:white;border:1px solid #c7d9dc;border-radius:7px;font-size:1.6rem;line-height:1}
.catalog input[type=search]{width:100%;padding:10px;border:1px solid #bbced2;border-radius:7px;margin-bottom:10px}
.categories{display:flex;gap:7px;overflow:auto;padding:0 0 12px}
.categories button{border:1px solid #c9d9dc;background:white;color:#285861;padding:8px 13px;border-radius:99px;white-space:nowrap;font-size:.9rem;font-weight:800}
.categories button.active{background:#28636b;color:white;border-color:#28636b}
.tiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;max-height:calc(100vh - 230px);min-height:390px;overflow:auto;align-content:start}
.drink{min-height:104px;border:2px solid #cfe0e3;border-radius:8px;background:#f4fafb;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:7px;text-align:center;color:#17323b}
.drink[data-category="Beer"]{background:#e9f4fa;border-color:#d1e3eb}
.drink[data-category="RTD & Cider"]{background:#fff2e8;border-color:#f2decc}
.drink[data-category="Non-alcoholic"]{background:#edf8f0;border-color:#d4ead9}
.drink:active{filter:brightness(.9)}
.drink-name{font-weight:760;line-height:1.18;font-size:.98rem;overflow-wrap:anywhere}
.drink-price{font-size:.9rem;font-weight:750;color:#23646b}
.drink img{width:47px;height:47px;object-fit:cover;border-radius:5px}
.ticket{padding:18px;display:flex;flex-direction:column;min-height:500px}
.ticket h2{font-size:1.1rem;margin:0}
.basket{flex:1;min-height:180px;padding:14px 0}
.empty{color:#72838a;text-align:center;padding-top:45px}
.basket-line{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #e5edef}
.basket-line b{font-size:.93rem}
.basket-line small{display:block;color:#657a80;margin-top:4px}
.qty{display:flex;align-items:center;gap:8px}
.qty button{border:1px solid #c7d9dc;background:white;border-radius:6px;width:29px;height:29px;font-size:1.1rem}
.total{display:flex;justify-content:space-between;align-items:center;border-top:2px solid #dce8e9;padding:12px 0;font-weight:800}
.total strong{font-size:1.65rem}
.ticket-bottom>.primary{width:100%}
.ticket-bottom>.text-button{display:block;margin:4px auto}
.sale-done{background:#e7f4ef;border:1px solid #badbcf;border-radius:9px;padding:15px;text-align:center;margin:9px 0}
.sale-done span,.sale-done strong{display:block}
.sale-done strong{font-size:2rem;margin:7px}
.sale-done button{width:100%}
.recent{border-top:1px solid #e0eaec;margin-top:13px;padding-top:12px;font-size:.86rem}
.recent h3{font-size:.9rem;margin:0 0 9px}
.recent-item{display:flex;justify-content:space-between;gap:10px;padding:5px 0}
.recent-item small{display:block;color:#687e84}
.recent .text-button{margin-top:7px}
.section-head{display:flex;align-items:start;justify-content:space-between;gap:12px;margin-bottom:17px}
.section-head p{margin:0;color:#677e85}
.section-head h1{margin-bottom:3px}
.view h2{font-size:1.1rem}
.session-card,.product-row,.transaction-row,.backup{background:white;border:1px solid #d7e3e5;border-radius:9px;padding:16px;margin-bottom:9px}
.session-card strong,.product-row strong{display:block}
.session-card small,.product-row small{color:#668087}
.session-card .metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:15px 0}
.metric{background:#f1f6f6;border-radius:7px;padding:11px}
.metric span,.metric strong{display:block}
.metric span{font-size:.78rem;color:#5d777e}
.metric strong{font-size:1.28rem}
.session-card .actions{justify-content:flex-start}
.product-row{display:flex;align-items:center;gap:12px}
.product-row img,.product-thumb{width:48px;height:48px;border-radius:7px;object-fit:cover;background:#edf3f4;display:grid;place-items:center;color:#719097}
.product-info{flex:1;min-width:0}
.product-row button{white-space:nowrap}
.backup{margin-top:22px}
.backup p,.hint{color:#5e777f;line-height:1.45}
.file-label input{display:none}
.backup .secondary{display:inline-block;margin-right:7px}
.transaction-row{display:flex;align-items:start;justify-content:space-between;gap:12px}
.transaction-row p{margin:5px 0;color:#5d767e;font-size:.87rem}
.transaction-row .money{text-align:right}
.transaction-row button{margin-top:7px}
.tag{font-size:.75rem;background:#f2eee5;color:#765a25;border-radius:99px;padding:3px 7px}
.tag.void{background:#fae8e8;color:#8b4545}
dialog{border:0;border-radius:12px;padding:0;box-shadow:0 25px 90px #091c2470;width:min(440px,calc(100vw - 24px));max-height:calc(100vh - 24px)}
dialog::backdrop{background:#0b2535a8}
.modal{padding:23px;overflow:auto;max-height:calc(100vh - 24px)}
.modal h2{margin:0 0 17px;font-size:1.3rem}
.modal label:not(.check){display:block;font-weight:750;font-size:.87rem;margin-bottom:13px}
.modal input:not([type=checkbox]),.modal select{display:block;width:100%;margin-top:5px;border:1px solid #bfd2d5;border-radius:7px;padding:10px;min-height:43px;background:white}
.fields{display:grid;grid-template-columns:1fr 1fr;gap:11px}
.actions{display:flex;justify-content:flex-end;gap:9px;margin-top:20px;flex-wrap:wrap}
.check{display:flex;align-items:center;gap:8px;margin-top:7px}
.check input{width:18px;height:18px}
.image-row{display:flex;align-items:center;gap:15px}
.image-row img{width:65px;height:65px;border-radius:7px;object-fit:cover}
.editor-line{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:8px 0}
.editor-line input{width:75px!important;margin:0!important}
.editor-total{font-weight:850;font-size:1.2rem;padding:12px 0;border-top:1px solid #ddd}
.danger{color:#a03b3b!important}
#toast{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);background:#143b42;color:white;padding:10px 16px;border-radius:8px;box-shadow:0 4px 18px #102d3644;opacity:0;pointer-events:none;transition:opacity .2s}
#toast.show{opacity:1}
@media(max-width:850px){.topbar{flex-wrap:wrap;gap:8px;padding:9px 13px}
.brand{width:100%}
.save-status{position:absolute;right:13px;top:16px}
.topbar nav{width:100%;justify-content:space-around}
.tab{flex:1}
.view{padding:12px}
.sell-grid{grid-template-columns:minmax(0,1fr) 275px}
.tiles{grid-template-columns:repeat(3,minmax(0,1fr));max-height:none}
.catalog,.ticket{padding:12px}
}
@media(max-width:620px){.sell-grid{display:flex;flex-direction:column}
.catalog{border-right:0;border-bottom:1px solid #dbe7e9}
.tiles{grid-template-columns:repeat(3,minmax(0,1fr));max-height:45vh;min-height:220px}
.drink{min-height:90px}
.ticket{min-height:0}
.basket{min-height:70px}
.session-card .metrics{grid-template-columns:repeat(2,1fr)}
.session-strip{padding:10px}
.session-strip strong{font-size:.9rem}
.session-strip span{font-size:.77rem}
.section-head{align-items:center}
}
:root{--total-green:#e5f3ee}
.total{background:var(--total-green);border:2px solid #98c9ba;border-radius:10px;padding:13px 15px;margin:0 0 9px;min-height:78px}.total strong{font-size:2.15rem;color:#14534b}.total.recorded{background:#fff0d9;border-color:#e7b66d}.total.recorded strong{color:#674112}.ticket.recorded #record-sale{background:#f2aa54;color:#17323b}.ticket.recorded .qty button{visibility:hidden}.ticket-bottom>.text-button:disabled{opacity:1;color:#866019;cursor:default;text-decoration:none}.session-detail{padding:18px;margin:14px 0 22px;border:1px solid #d7e3e5;border-radius:9px}.session-detail h2{margin:0 0 4px}.session-detail .hint{margin:3px 0 14px}.usage-wrap{overflow:auto}.usage-table{border-collapse:collapse;width:100%;min-width:570px}.usage-table th,.usage-table td{padding:10px 8px;border-bottom:1px solid #e1eaeb;text-align:right}.usage-table th:first-child,.usage-table td:first-child{text-align:left}.usage-table th{font-size:.78rem;color:#607981}.usage-table tfoot td{font-weight:850;background:#f2f7f7}.session-card .actions{margin-top:12px}
.danger-button{border:1px solid #dca7a7;background:#fff4f4;color:#a13d3d;border-radius:8px;padding:11px 15px;font-weight:800;min-height:43px;margin-right:auto}
.session-delete{border-color:#dca7a7;color:#a03b3b;background:#fff4f4}
.sale-action{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:72px;text-align:left;padding:11px 14px}
.sale-action-copy{display:flex;flex-direction:column;gap:3px}
.sale-action-copy small{font-size:.74rem;font-weight:600;opacity:.85}
.sale-action strong{font-size:1.75rem;white-space:nowrap}
.ticket.recorded .sale-action{background:#f2aa54;color:#17323b}

/* Compact tablet layout: keep the sale controls in the available app height. */
@media (orientation:landscape) and (max-height:820px){
  body.sell-active{height:100vh;height:100dvh;overflow:hidden;display:flex;flex-direction:column}
  body.sell-active main{width:100%;flex:1;min-height:0;margin:0 auto}
  #sell-view{height:100%;display:flex;flex-direction:column;min-height:0;overflow:hidden;padding-bottom:24px}
  .topbar{min-height:52px;padding:5px 12px;gap:12px;flex-wrap:nowrap}
  .brand{width:auto;font-size:1.05rem}
  .brandmark{width:27px;height:27px}
  .topbar nav{width:auto;margin-left:auto}
  .tab{padding:8px 11px}
  .save-status{display:none}
  .view{padding:8px 10px}
  .session-strip{padding:7px 12px;margin-bottom:8px}
  .session-strip span{margin-top:1px}
  .session-strip .accent{min-height:38px;padding:7px 11px}
  .session-strip{flex:none}
  .sell-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(230px,32%);flex:1;height:auto;min-height:0}
  .catalog{display:flex;flex-direction:column;min-height:0;padding:10px}
  .catalog{border-right:1px solid #dbe7e9;border-bottom:0}
  .catalog h1{font-size:1.28rem;margin-bottom:6px}
  .categories{padding-bottom:7px;gap:5px}
  .categories button{padding:6px 10px}
  .tiles{flex:1;min-height:0;max-height:none;gap:6px}
  .drink{min-height:80px;padding:5px;gap:3px}
  .drink-name{font-size:.88rem}
  .drink-price{font-size:.8rem}
  .drink img{width:37px;height:37px}
  .ticket{min-height:0;padding:10px;overflow-y:auto;overscroll-behavior:contain}
  .basket{flex:none;height:230px;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;border:0;border-radius:0;background:white;padding:4px 3px 4px 0;margin:8px 0 10px}
  .basket-line{padding:6px 0}
  .basket-line>div:first-child{min-width:0;flex:1}
  .basket-line b{font-size:.9rem;line-height:1.15;overflow-wrap:anywhere}
  .basket-line small{display:inline;font-size:.72rem;margin:0 0 0 5px}
  .ticket-bottom{flex:none;min-height:0;display:block;position:relative;z-index:1;background:white}
  .ticket-bottom>.text-button{flex:none;padding:6px 4px;margin:3px auto}
  .empty{padding-top:16px}
  .sale-action{min-height:84px;padding:10px 12px}
  .sale-action strong{font-size:1.95rem}
  .recent{display:block;flex:none;min-height:0;margin-top:3px;padding-top:4px}
  .recent h3{margin-bottom:3px}
  .recent-item{padding:3px 0}
  #recent-sales{display:block;max-height:none;overflow:visible}
  .recent .text-button{flex:none}
}
.drink-name{font-size:1.18rem;line-height:1.12}
.drink-price{font-size:.72rem}
.recent-head{display:flex;align-items:center;justify-content:space-between;gap:6px;flex:none}
.recent-head h3{margin:0}
.recent-head .text-button{margin:0;min-height:38px;padding:5px 0;font-size:.83rem;white-space:nowrap}
.usage-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.usage-heading .text-button{white-space:nowrap}

/* Distinct sale cards with controls held between the order and recent sales. */
.brandmark{width:39px;font-size:.76rem;letter-spacing:-.04em}
.sell-grid{gap:8px;border:0;border-radius:0;overflow:visible;box-shadow:none}
.catalog,.ticket,.ticket-bottom,.recent{border:1px solid #d3e1e3;border-radius:10px;box-shadow:0 2px 10px #18343b0a}
.catalog{border-right:1px solid #d3e1e3}
.ticket-stack{display:grid;grid-template-rows:minmax(0,min(220px,45%)) auto minmax(0,1fr);gap:8px;min-width:0;min-height:0}
.ticket{min-height:0;overflow:hidden}
.ticket-head{display:flex;align-items:center;justify-content:space-between;gap:4px}
#basket-scroll-hint{color:#52757d;font-size:.68rem;font-weight:700;white-space:nowrap}
.basket{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;touch-action:pan-y;-webkit-overflow-scrolling:touch}
.basket::-webkit-scrollbar{width:8px}.basket::-webkit-scrollbar-thumb{background:#9ab9be;border-radius:8px}.basket::-webkit-scrollbar-track{background:transparent}
.ticket-bottom{padding:9px 12px;min-width:0}
.ticket-bottom>.primary{width:100%}
.ticket-bottom>.text-button{display:block;margin:2px auto 0;padding:5px 4px}
.ticket-stack.recorded #record-sale{background:#f2aa54;color:#17323b}
.ticket-stack.recorded .qty button{visibility:hidden}
.ticket-bottom>.text-button:disabled{opacity:1;color:#866019;cursor:default;text-decoration:none}
.recent{margin:0;padding:8px 11px;min-height:0;display:flex;flex-direction:column;overflow:hidden}
#recent-sales{min-height:0;overflow:auto;scrollbar-width:thin}
.manage-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
.manage-card{display:flex;flex-direction:column;align-items:flex-start;gap:8px;text-align:left;min-height:118px;padding:16px;border:1px solid #cddfe2;border-radius:10px;background:white;color:#17323b;box-shadow:0 2px 10px #18343b0a}
.manage-card strong{font-size:1.12rem}.manage-card span{color:#607981;font-size:.9rem;line-height:1.3}.manage-card b{color:#24636b;margin-top:auto;font-size:.85rem}
.manage-card.coming{background:#f7f9f9;color:#657a80;box-shadow:none}.manage-card.coming b{color:#72868a}
@media(max-width:620px){.manage-grid{grid-template-columns:1fr}.ticket-stack{display:flex;flex-direction:column}.ticket{min-height:190px}.basket{max-height:220px}.recent{min-height:115px}.catalog{border-bottom:1px solid #d3e1e3}}
@media (orientation:landscape) and (max-height:820px){
  #sell-view{padding-bottom:10px}
  .brandmark{width:34px;height:27px;font-size:.7rem}
  .sell-grid{gap:7px}
  .catalog{border:1px solid #d3e1e3}
  .ticket-stack{display:grid;grid-template-rows:minmax(0,min(220px,45%)) auto minmax(0,1fr);gap:6px;height:100%}
  .ticket{min-height:0;overflow:hidden;padding:8px}
  .ticket h2{line-height:1.2}
  .basket{flex:1;height:auto;min-height:0;margin:5px 0 0;padding:2px 3px 2px 0}
  .basket-line{padding:4px 0}
  .ticket-bottom{padding:6px 8px}
  .sale-action{min-height:66px;padding:7px 10px}
  .ticket-bottom>.text-button{margin:0 auto;padding:3px 4px;font-size:.78rem}
  .recent{margin:0;padding:3px 8px;overflow:hidden}
  .recent-head .text-button{min-height:28px;padding:2px 0}
  #recent-sales{max-height:none;overflow:auto}
}

/* One sale card: reserve most of its height for drinks, with stable controls. */
.ticket-stack{grid-template-rows:minmax(0,min(320px,58%)) auto minmax(0,1fr);gap:0;border:1px solid #d3e1e3;border-radius:10px;box-shadow:0 2px 10px #18343b0a;overflow:hidden}
.ticket-stack .ticket,.ticket-stack .ticket-bottom,.ticket-stack .recent{border:0;border-radius:0;box-shadow:none}
.ticket-stack .ticket-bottom{border-top:1px solid #e0eaec;border-bottom:1px solid #e0eaec}
.ticket-stack .recent{border-top:0}
@media(max-width:620px){.ticket-stack{display:flex;flex-direction:column}.ticket-stack .ticket{min-height:190px}.ticket-stack .recent{min-height:115px}}
@media (orientation:landscape) and (max-height:820px){
  .ticket-stack{display:grid;grid-template-rows:minmax(0,min(320px,58%)) auto minmax(0,1fr);gap:0}
  .ticket-stack .ticket-bottom{padding:4px 8px}
  .ticket-stack .sale-action{min-height:61px}
  .ticket-stack .ticket-bottom>.text-button{padding:2px 4px}
  .ticket-stack .recent{padding:3px 8px}
}

/* Pictures sit beside adaptive labels without changing pictureless drink cards. */
.drink.has-image{display:grid;grid-template-columns:minmax(38px,32%) minmax(0,1fr);grid-template-rows:1fr auto;align-items:center;justify-items:start;column-gap:8px;text-align:left}
.drink.has-image img{grid-row:1 / 3;width:100%;height:auto;aspect-ratio:1;object-fit:cover}
.drink.has-image .drink-name{align-self:end;font-size:clamp(.78rem,1.28vw,1.08rem);line-height:1.12}
.drink.has-image .drink-price{align-self:start;font-size:.72rem}
.storage-option{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:12px}
.storage-option .hint{font-size:.83rem}
@media(max-width:850px){.drink.has-image{grid-template-columns:minmax(34px,30%) minmax(0,1fr);column-gap:5px}.drink.has-image .drink-name{font-size:clamp(.72rem,1.5vw,.96rem)}}

/* Stock entry keeps names visible while counting on a tablet. */
.stock-dialog{width:min(650px,calc(100vw - 24px))}
.stock-inputs{max-height:45vh;overflow:auto;border:1px solid #d7e3e5;border-radius:8px;padding:6px 12px}
.stock-inputs h3{font-size:.9rem;margin:12px 0 4px;color:#28636b}
.stock-row{display:flex!important;align-items:center;justify-content:space-between;gap:14px;margin:0!important;padding:6px 0;border-bottom:1px solid #edf2f3}
.stock-row span{min-width:0;flex:1}
.stock-row input{width:85px!important;min-width:85px;margin:0!important;text-align:right}
.stock-table{min-width:620px}
.session-card details{margin-top:12px}
.session-card summary{cursor:pointer;color:#24636b;font-weight:750}

/* Keep the main action easy to hit without letting the order list grow. */
.ticket-stack .sale-action{min-height:clamp(76px,9vh,104px)}
@media (orientation:landscape) and (max-height:820px){.ticket-stack .sale-action{min-height:76px}}

/* Keep the whole Sell workspace bounded by the landscape tablet viewport. */
@media (orientation:landscape) and (min-width:621px){
  body.sell-active{height:100vh;height:100dvh;overflow:hidden;display:flex;flex-direction:column}
  body.sell-active main{width:100%;flex:1;min-height:0;margin:0 auto}
  #sell-view{height:100%;display:flex;flex-direction:column;min-height:0;overflow:hidden}
  .session-strip{flex:none}
  .sell-grid{flex:1;height:auto;min-height:0;max-height:720px}
  .catalog{display:flex;flex-direction:column;min-height:0}
  .tiles{flex:1;min-height:0;max-height:none}
  .ticket-stack{height:100%;min-height:0;grid-template-rows:minmax(0,58%) auto minmax(0,1fr)}
  .ticket-stack .ticket,.ticket-stack .basket,.ticket-stack .recent,#recent-sales{min-height:0}
}
