/* Same fonts as jalchhabihotel.in (self-hosted, SIL OFL 1.1, licences in /fonts/) */
@font-face{font-family:'Manrope';font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/manrope-latin-400-normal.woff2) format('woff2')}
@font-face{font-family:'Manrope';font-style:normal;font-weight:600;font-display:swap;src:url(/fonts/manrope-latin-600-normal.woff2) format('woff2')}
@font-face{font-family:'Cormorant Garamond';font-style:normal;font-weight:500;font-display:swap;src:url(/fonts/cormorant-garamond-latin-500-normal.woff2) format('woff2')}
/* Colours from the hotel website: ivory, charcoal and brass */
:root { --bg:#F7F4EE; --card:#fff; --ink:#1A1A1A; --muted:#6B675B; --line:#E3DCCD; --brand:#7D5C26; --brand2:#C9A86A; --dark:#1E1E1E; --ok:#1d7a3e; --bad:#b42318; --wa:#1fa855; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); font-size: 16px; padding-bottom: env(safe-area-inset-bottom); }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; } .r { text-align: right; } .c { text-align: center; } .nowrap { white-space: nowrap; }
.ok { color: var(--ok); } .err { color: var(--bad); } .grow { flex: 1; }
h1, h2 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 500; letter-spacing: .01em; }
h2 { margin: 0 0 12px; font-size: 26px; } h3 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
input, select, textarea { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); width: 100%; min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand2); border-color: transparent; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand); }
label { display: block; font-size: 14px; color: var(--muted); }
label input, label select, label textarea { margin-top: 4px; }
label.chk { display: flex; align-items: center; gap: 10px; color: var(--ink); margin: 8px 0; }
.btn { font: inherit; background: #fff; border: 1px solid var(--line); color: var(--ink); padding: 10px 16px; border-radius: 10px; cursor: pointer; min-height: 44px; touch-action: manipulation; }
.btn:disabled { opacity: .5; cursor: wait; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
.btn.danger { color: var(--bad); border-color: #f0c3be; } .btn.danger.grow { background: var(--bad); color: #fff; }
.btn.ghost { background: transparent; } .btn.small { padding: 6px 12px; min-height: 36px; font-size: 14px; }
.btn.wa { background: var(--wa); color: #fff; border-color: var(--wa); font-weight: 600; }
.btn.block { width: 100%; } .btn.light { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { width: 100%; max-width: 360px; display: grid; gap: 10px; text-align: center; }
.login h1 { margin: 0; color: var(--brand); font-size: 34px; line-height: 1.1; } .login p { margin: 0; } .logo { width: 120px; height: auto; margin: 0 auto; }
.login .btn.primary { letter-spacing: .12em; text-transform: uppercase; font-size: 14px; }

header { background: var(--dark); color: #F7F4EE; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: max(8px, env(safe-area-inset-top)) 12px 0; position: sticky; top: 0; z-index: 10; }
.brand { flex: 1; display: flex; align-items: center; gap: 10px; font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 500; font-size: 24px; color: var(--brand2); min-width: 0; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .hlogo { height: 34px; width: auto; flex: none; }
.who { font-size: 14px; opacity: .9; } .badge { background: rgba(255,255,255,.2); padding: 2px 8px; border-radius: 99px; font-size: 12px; }
nav { flex-basis: 100%; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
nav::-webkit-scrollbar { display: none; }
nav button { background: transparent; border: 0; color: #CFC8B8; padding: 10px 14px; border-radius: 10px; font: inherit; white-space: nowrap; cursor: pointer; }
nav button.active { background: rgba(201,168,106,.18); color: var(--brand2); font-weight: 600; box-shadow: inset 0 -2px 0 var(--brand2); }
.menu { position: fixed; right: 10px; top: 54px; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); overflow: hidden; }
.menu button { display: block; width: 100%; padding: 14px 18px; border: 0; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.menu button:hover { background: #faf4ee; }
main { padding: 12px; max-width: 1200px; margin: 0 auto; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.toolbar input:not([type=checkbox]) { width: auto; flex: 1 1 140px; }
.toolbar label.chk { margin: 0; }

/* sell */
.sell { display: grid; grid-template-columns: 1fr 360px; gap: 12px; align-items: start; }
.searchbox { position: relative; margin-bottom: 10px; }
.searchbox input { font-size: 18px; border: 2px solid var(--brand2); min-height: 52px; }
.sugg { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); max-height: 60vh; overflow: auto; }
.sugg .opt { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 14px; border: 0; border-bottom: 1px solid var(--line); background: #fff; font: inherit; text-align: left; cursor: pointer; }
.sugg .opt:hover { background: #fbefe5; } .sugg .opt span { color: var(--muted); white-space: nowrap; } .pad { padding: 14px; }
.line { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name x" "qty amt" "disc amt"; gap: 6px 10px; align-items: center; }
.line.short { border-color: #f0c3be; background: #fff8f7; }
.lname { grid-area: name; } .lname small { display: block; color: var(--muted); }
.line .x { grid-area: x; border: 0; background: none; color: var(--bad); font-size: 20px; width: 40px; height: 40px; cursor: pointer; }
.qty { grid-area: qty; display: flex; align-items: center; gap: 6px; }
.qty button { width: 44px; height: 44px; border: 1px solid var(--line); background: #fff; border-radius: 10px; font-size: 20px; cursor: pointer; touch-action: manipulation; }
.qty input { width: 64px; text-align: center; }
.disc { grid-area: disc; display: flex; align-items: center; gap: 6px; } .disc input { width: 70px; margin: 0; text-align: center; }
.lamt { grid-area: amt; font-weight: 700; font-size: 18px; text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.sell-right { position: sticky; top: 110px; }
.custrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .card.cust { margin-top: 4px; }
@media (max-width: 520px) { .custrow { grid-template-columns: 1fr; } }
details summary { cursor: pointer; color: var(--brand); padding: 6px 0; } details > input, details > select { margin-bottom: 6px; }
table.tot { width: 100%; margin: 0 0 10px; border-collapse: collapse; } table.tot td { padding: 4px 0; } table.tot td + td { text-align: right; }
table.tot .grand td { font-size: 26px; font-weight: 800; border-top: 2px solid var(--ink); padding-top: 8px; }
.paybtns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.btn.pay { color: #fff; border: 0; font-weight: 700; font-size: 17px; min-height: 56px; padding: 8px 4px; }
.pay.cash { background: #1d7a3e; } .pay.upi { background: #3b3fb6; } .pay.card { background: #444; }

/* lists */
.list { display: grid; gap: 8px; }
.row-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.row-card.cancelled { opacity: .6; } .row-card.low { border-color: #f0c3be; }
.rc-amt { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.rc-act { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #eee; } .pill.cash { background: #dff3e5; } .pill.upi { background: #e3e4fa; } .pill.card { background: #e8e8e8; }
.pill.bad { background: #fde2df; color: var(--bad); } .pill.owner { background: #fbe5d6; color: var(--brand); }
.stock { font-weight: 600; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; } table.tbl td, table.tbl th { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; } table.tbl .r { text-align: right; }
.scroll { max-height: 55vh; overflow: auto; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(30,20,10,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: #fff; border-radius: 16px; padding: 18px; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; } .form .wide, .form details { grid-column: 1 / -1; }
.form details .form { margin-top: 8px; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.col { display: grid; gap: 8px; margin-top: 12px; }
.big { font-size: 40px; font-weight: 800; text-align: center; margin: 4px 0 14px; }
.change { font-size: 22px; margin-top: 10px; } .done { font-size: 54px; text-align: center; }

/* dashboard */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; } .kpi.warn { background: #fff4f2; }
.kpi span { color: var(--muted); font-size: 13px; } .kpi b { display: block; font-size: 22px; margin: 4px 0; } .kpi small { color: var(--muted); font-size: 12px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bar { display: grid; grid-template-columns: 44px 1fr 100px; gap: 8px; align-items: center; margin: 5px 0; font-size: 14px; }
.bar i { display: block; height: 14px; background: var(--brand2); border-radius: 4px; min-width: 2px; } .bar b { text-align: right; }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; } .settings .card { margin: 0; display: grid; gap: 10px; align-content: start; }
.savebar { grid-column: 1 / -1; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #2b2118; color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 60; max-width: 92vw; text-align: center; }
.toast.bad { background: var(--bad); }

@media (max-width: 860px) {
  .sell, .cols { grid-template-columns: 1fr; }
  .sell-right { position: sticky; bottom: 0; top: auto; margin: 0 -12px -12px; border-radius: 16px 16px 0 0; box-shadow: 0 -6px 20px rgba(0,0,0,.1); padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .who { display: none; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-box { border-radius: 16px 16px 0 0; max-height: 94vh; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .form { grid-template-columns: 1fr; }
  .big { font-size: 34px; }
}
@media (max-width: 860px) {
  .sell-right table.tot tr:not(.grand) { display: none; }
  .sell-right table.tot .grand td { font-size: 22px; border-top: 0; padding-top: 0; }
  .btn.pay { font-size: 15px; min-height: 50px; }
  #clearBill { margin-top: 2px; }
}
.itemno{font-family:ui-monospace,Menlo,Consolas,monospace;letter-spacing:.5px}
.lbN{width:5em;text-align:right}
.qr { width: 200px; height: 200px; margin: 0 auto; background: #fff; } .qr svg { width: 100%; height: 100%; }
.steps { text-align: left; margin: 0; padding-left: 20px; } .steps li { margin: 2px 0; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 16px; }
.codes span { background: var(--bg, #f6f2ec); border: 1px solid var(--line); border-radius: 6px; padding: 6px; }
.pill.ok { background: #e3f4e6; color: #1d6b2c; }
.logo-prev { max-width: 180px; max-height: 80px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px; }
.qrow { display: flex; gap: 8px; } .qrow input { flex: 1; min-width: 0; } .qrow .btn { flex: none; }
.scanbox { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; max-height: 60vh; margin: 0 auto 8px; }
.scanbox video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanline { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: #e33; box-shadow: 0 0 8px #e33; }
