/* ============ Admin ============ */
body.admin { background: var(--paper); min-height: 100dvh; }
.muted { color: var(--muted); margin: 4px 0 0; font-size: 0.95rem; }

/* login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; position: relative; overflow: hidden; background: radial-gradient(120% 90% at 85% 10%, #5a2216 0%, var(--ink) 55%, #1d0d08 100%); }
.login__card { width: min(400px, 100%); border-radius: 26px; padding: 30px 26px; display: grid; gap: 14px; background: rgba(255, 246, 230, 0.1); border-color: var(--glass-dark-line); color: #fff3e0; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7); }
.login__logo { width: 64px; height: 64px; }
.login h1 { font-size: 2.4rem; }
.login h1 em { color: var(--haldi); }
.login__sub { margin: -6px 0 6px; color: rgba(255, 243, 224, 0.7); }
.login label { display: grid; gap: 6px; font-size: 0.9rem; font-weight: 500; }
.login input { padding: 13px 14px; border-radius: 12px; border: 1px solid var(--glass-dark-line); background: rgba(0, 0, 0, 0.25); color: #fff; outline: 0; font-size: 1rem; }
.login input:focus { border-color: var(--haldi); }
.login__err { color: #ffb4a8; margin: 0; min-height: 1.2em; font-size: 0.92rem; }
.login__demo { font-size: 0.85rem; color: rgba(255, 243, 224, 0.6); margin: 0; }
.login__demo code { color: var(--haldi-soft); }
.login__forgot { color: rgba(255, 243, 224, 0.75) !important; font-size: 0.9rem; justify-self: center; }
.login__back { color: rgba(255, 243, 224, 0.7); font-size: 0.9rem; text-align: center; }

/* shell */
.app { max-width: 920px; margin: 0 auto; padding-bottom: 110px; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: rgba(244, 231, 207, 0.8); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.topbar .brand__name i { color: var(--chili); }
.savestate { margin-left: auto; font-size: 0.85rem; color: var(--muted); }
.savestate.ok { color: var(--leaf); }
.demo-bar { background: var(--haldi); color: var(--ink); font-size: 0.88rem; font-weight: 500; text-align: center; padding: 8px 14px; }

.tabs { display: flex; gap: 6px; padding: 14px 16px 0; }
.tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 0; background: transparent; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.tabs button .ic { width: 20px; height: 20px; }
.tabs button.is-on { background: var(--ink); color: #fff6e8; }

.panes { padding: 10px 16px 0; }
.pane__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 14px 0 18px; flex-wrap: wrap; }
.pane__head h2 { font-size: 2rem; }
.pane__btns { display: flex; gap: 8px; }
.notice { background: #fff8e6; border: 1px solid #f2d28a; border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; display: grid; gap: 10px; }
.notice p { margin: 0; }
.notice__btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* form basics */
.form { display: grid; gap: 14px; }
.form fieldset { border: 1px solid var(--line); background: #fffaf1; border-radius: 18px; padding: 16px; margin: 0; display: grid; gap: 12px; }
.form legend { font-family: var(--f-display); font-weight: 600; font-size: 1.2rem; padding: 0 6px; }
.form label, .meal-ed label { display: grid; gap: 6px; font-size: 0.9rem; font-weight: 500; }
.form label small { color: var(--muted); font-weight: 400; }
.form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .form select, .form textarea, .meal-ed input:not([type="checkbox"]), .meal-ed textarea {
  width: 100%; padding: 12px 13px; border-radius: 12px; border: 1px solid var(--line); background: #fff; outline: 0; font-size: 1rem;
}
.form input:focus, .form select:focus, .form textarea:focus, .meal-ed input:focus, .meal-ed textarea:focus { border-color: var(--ink); }
.switch-row { display: flex !important; justify-content: space-between; align-items: center; gap: 12px; }

/* switch */
.switch { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 999px; background: #d9cbb4; position: relative; cursor: pointer; flex: none; transition: background 0.25s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform 0.25s var(--ease); }
.switch:checked { background: var(--leaf); }
.switch:checked::after { transform: translateX(20px); }

/* meal editor */
.meal-ed { background: #fffaf1; border: 1px solid var(--line); border-radius: 20px; padding: 18px; margin-bottom: 14px; display: grid; gap: 12px; transition: opacity 0.2s; }
.meal-ed__top { display: flex; align-items: center; gap: 12px; }
.meal-ed__top h3 { font-size: 1.45rem; }
.meal-ed__top .meal__icon { width: 42px; height: 42px; }
.meal-ed__top .switch { margin-left: auto; }
.meal-ed.is-off .meal-ed__body { display: none; }
.meal-ed.is-off { opacity: 0.7; }
.meal-ed__body { display: grid; gap: 12px; }
.chiplist { display: flex; flex-wrap: wrap; gap: 6px; }
.chiplist button { border: 1px dashed rgba(42, 20, 13, 0.3); background: #fff; border-radius: 999px; padding: 5px 11px; font-size: 0.85rem; cursor: pointer; }
.chiplist button:hover { border-style: solid; }
.items-ed { display: grid; gap: 6px; }
.items-ed__row { display: flex; gap: 6px; }
.items-ed__row input { flex: 1; }
.items-ed__row button { width: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; flex: none; display: grid; place-items: center; }
.items-ed__row button .ic { width: 18px; height: 18px; }
.add-line { justify-self: start; border: 0; background: none; color: var(--chili); font-weight: 600; cursor: pointer; padding: 4px 0; }
.row3 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sticky-actions { position: sticky; bottom: 14px; padding-top: 6px; z-index: 5; }
.sticky-actions .btn { box-shadow: 0 16px 30px -10px rgba(42, 20, 13, 0.5); }

/* category list */
.admin-search { width: 100%; height: 48px; margin-bottom: 16px; }
.acat { background: #fffaf1; border: 1px solid var(--line); border-radius: 20px; margin-bottom: 14px; overflow: hidden; }
.acat__head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 16px; }
.acat__head .cat__icon { width: 40px; height: 40px; border-radius: 12px; }
.acat__head .cat__icon .ic { width: 22px; height: 22px; }
.acat__title { flex: 1; min-width: 0; }
.acat__title h3 { font-size: 1.3rem; }
.acat__title small { color: var(--muted); }
.acat.is-hidden .acat__title h3 { text-decoration: line-through; opacity: 0.6; }
.mini { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; font-size: 0.9rem; flex: none; }
.mini:disabled { opacity: 0.35; cursor: default; }
.aitem { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.aitem__photo { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; background: var(--paper); }
.aitem__main { flex: 1; min-width: 0; cursor: pointer; }
.aitem__name { font-weight: 600; line-height: 1.25; }
.aitem__meta { font-size: 0.85rem; color: var(--muted); }
.aitem .tag { display: inline-block; font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; background: var(--haldi-soft); padding: 2px 7px; border-radius: 999px; font-weight: 700; vertical-align: 2px; }
.aitem.is-out .aitem__name { color: var(--muted); }
.aitem.is-out .aitem__meta::after { content: " · Not today"; color: var(--chili); font-weight: 600; }

/* sheet */
.sheet { position: fixed; z-index: 61; top: 10px; right: 10px; bottom: 10px; width: min(480px, calc(100% - 20px)); display: flex; flex-direction: column; background: var(--cream); border-radius: 24px; box-shadow: 0 30px 80px -20px rgba(29, 13, 8, 0.6); transform: translateX(calc(100% + 20px)); transition: transform 0.45s var(--ease); }
.sheet.is-open { transform: none; }
.sheet__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 8px; }
.sheet__head h2 { font-size: 1.7rem; }
.sheet__body { flex: 1; overflow-y: auto; padding: 8px 20px 20px; align-content: start; }
.variants { display: grid; gap: 8px; }
.variant { display: grid; grid-template-columns: 1fr 110px 44px; gap: 6px; }
.variant button { border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; }
.variant button .ic { width: 18px; height: 18px; }
.photo-ed { display: flex; gap: 12px; align-items: center; }
.photo-ed img { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; background: var(--paper); }
.photo-ed .btn { position: relative; overflow: hidden; }
.photo-ed input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sheet__actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 6px; }
.btn--danger { --bg: #fff; --fg: var(--chili); border: 1px solid rgba(200, 55, 43, 0.4); }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick label { display: block; }
.icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick span { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; }
.icon-pick span .ic { width: 22px; height: 22px; }
.icon-pick input:checked + span { background: var(--ink); color: var(--haldi); border-color: var(--ink); }

/* share */
.share-preview { min-height: 420px; margin: 14px 0; }
.share-preview canvas { max-height: 62dvh; }
.share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }


/* ---------- orders dashboard ---------- */
.tabs button { position: relative; }
.tab-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--chili); color: #fff; font-size: 0.72rem; display: inline-grid; place-items: center; animation: pop 0.4s var(--ease); }
.daypick { display: flex; align-items: center; gap: 8px; font-weight: 600; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.daypick span { min-width: 92px; text-align: center; font-size: 0.92rem; }
.daypick .icon-btn { width: 34px; height: 34px; font-size: 1.3rem; line-height: 1; }
.daypick .icon-btn:disabled { opacity: 0.3; }
#orderTabs { margin-bottom: 14px; }
#orderTabs button { gap: 6px; }
#orderTabs .cnt { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
#orderTabs button.is-on .cnt { color: var(--ink); }
.prep { background: var(--ink); color: #fff6e8; border-radius: 18px; padding: 14px 16px; margin-bottom: 16px; }
.prep__k { margin: 0 0 8px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--haldi); font-weight: 700; }
.prep__row { display: flex; flex-wrap: wrap; gap: 8px; }
.prep__row span { background: rgba(255, 246, 230, 0.1); border: 1px solid rgba(255, 236, 205, 0.2); border-radius: 12px; padding: 6px 12px; font-size: 0.95rem; }
.prep__row b { font-family: var(--f-display); font-size: 1.2rem; color: var(--haldi); margin-right: 4px; }
.olist { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; align-items: start; }
.ocard { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; display: grid; gap: 10px; box-shadow: 0 10px 24px -18px rgba(42, 20, 13, 0.5); border-left: 5px solid var(--line); }
.ocard.is-new { border-left-color: var(--chili); animation: glow 2s ease-in-out 3; }
.ocard.is-accepted { border-left-color: var(--haldi); }
.ocard.is-ready { border-left-color: var(--leaf); }
.ocard.is-done, .ocard.is-cancelled { opacity: 0.6; }
.ocard.is-cancelled .ocard__lines { text-decoration: line-through; }
@keyframes glow { 50% { box-shadow: 0 0 0 4px rgba(200, 55, 43, 0.18); } }
.ocard__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ocard__no { font-family: var(--f-display); font-size: 1.35rem; }
.ocard__time { color: var(--muted); font-size: 0.85rem; margin: 0; }
.ocard__head .st { margin-left: auto; }
.pill { font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--paper); text-transform: uppercase; letter-spacing: 0.05em; }
.pill--party { background: rgba(200, 55, 43, 0.12); color: var(--chili); }
.ocard__who { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 0.95rem; }
.ocard__who a { color: var(--ink); font-weight: 600; }
.ocard__who .ocard__wa { color: var(--wa); }
.ocard__lines { list-style: none; margin: 0; padding: 0; border-top: 1px dashed var(--line); }
.ocard__lines li { display: grid; grid-template-columns: 34px 1fr auto; gap: 6px; padding: 7px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.ocard__lines b { font-size: 1.05rem; }
.ocard__lines small { color: var(--muted); }
.ocard__lines i { font-style: normal; font-weight: 600; }
.ocard__meal { display: block; font-size: 0.82rem; }
.ocard__note, .ocard__what { margin: 0; padding: 8px 12px; border-radius: 10px; background: #fff8e6; font-size: 0.92rem; white-space: pre-wrap; }
.ocard__event { margin: 0; font-size: 1.02rem; }
.ocard__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ocard__total { font-family: var(--f-display); font-size: 1.4rem; font-weight: 600; margin-right: auto; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 16px; background: #fff; border: 1px dashed var(--line); border-radius: 18px; }
.empty small { opacity: 0.8; }

@media (max-width: 640px) {
  .tabs { position: fixed; z-index: 40; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); padding: 6px; justify-content: space-between; border-radius: 22px; background: rgba(42, 20, 13, 0.9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 20px 40px -14px rgba(0, 0, 0, 0.6); }
  .tabs button { flex: 1; flex-direction: column; gap: 3px; padding: 8px 4px; font-size: 0.72rem; color: rgba(255, 243, 224, 0.75); border-radius: 16px; }
  .tabs button.is-on { background: var(--haldi); color: var(--ink); }
  .pane__head h2 { font-size: 1.7rem; }
  .tabs button { font-size: 0.68rem; padding: 8px 2px; }
  .tab-badge { position: absolute; top: 2px; right: 8px; min-width: 18px; height: 18px; font-size: 0.66rem; }
  .olist { grid-template-columns: 1fr; }
  .daypick { width: 100%; justify-content: space-between; }
  .sticky-actions { bottom: 92px; }
  .admin .toast { bottom: 170px; }
  .sheet { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 94dvh; border-radius: 24px 24px 0 0; transform: translateY(100%); }
  .sheet.is-open { transform: none; }
  .variant { grid-template-columns: 1fr 90px 44px; }
}

/* ---------- payments, reject reasons, bill, translations ---------- */
.ocard__pay { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: 12px; background: var(--paper); font-size: 0.9rem; }
.ocard__pay span { margin-right: auto; font-weight: 600; }
.ocard__pay.is-paid { background: rgba(47, 107, 53, 0.12); color: var(--leaf); }
.ocard__pay.is-claimed { background: rgba(242, 165, 30, 0.22); animation: glow 2s ease-in-out 3; }
.ocard__reject { display: none; padding: 10px; border-radius: 12px; background: rgba(200, 55, 43, 0.08); }
.ocard.is-rejecting .ocard__reject { display: grid; gap: 8px; }
.ocard.is-rejecting .ocard__foot { display: none; }
.ocard__reject p { margin: 0; font-weight: 600; font-size: 0.9rem; }
.ocard__reject div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ocard.is-rejected { opacity: 0.6; }
.ocard.is-rejected .ocard__lines { text-decoration: line-through; }
.st--rejected { background: rgba(200, 55, 43, 0.12); color: var(--chili); }
.sheet .bill { margin-bottom: 14px; }
.tr-box { border: 1px dashed var(--line); border-radius: 14px; padding: 10px 12px; }
.tr-box summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; }
.tr-box[open] { display: grid; gap: 10px; }
.rev-ed { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: #fff; }

.hist { display: inline-block; justify-self: start; font-size: 0.78rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--paper); color: var(--muted); }
.hist.is-bad { background: rgba(200, 55, 43, 0.12); color: var(--chili); }
.ocard__pay.is-wait { background: rgba(242, 165, 30, 0.22); }
.ocard__pay.is-refund { background: rgba(200, 55, 43, 0.1); color: var(--chili); }
.ocard.is-no_show { opacity: 0.6; }
.st--no_show { background: rgba(200, 55, 43, 0.12); color: var(--chili); }

@media (max-width: 640px) {
  .ocard__foot .ocard__total { flex: 1 0 100%; margin: 0; }
  .ocard__foot .btn { flex: 1 1 auto; }
  .ocard__pay { font-size: 0.85rem; }
  .ocard__pay span { flex: 1 0 100%; }
}

/* =================== owner dashboard: layout for phone & computer =================== */
.tabs .tab-more-btn, .more-menu { display: none; }
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs button { white-space: nowrap; }
.tab--new { background: var(--haldi) !important; color: var(--ink) !important; }
.tab--new.is-on { box-shadow: 0 0 0 2px var(--ink) inset; }
.sub-h { font-size: 1.1rem; margin: 22px 0 10px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.sub-h small { font-family: var(--f-body); font-weight: 500; font-size: 0.8rem; color: var(--muted); }
.card-box { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 4px 16px 16px; margin-top: 16px; }
.card-box > .sub-h:first-child { margin-top: 14px; }

/* stat tiles */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; min-width: 0; }
.kpi__l { margin: 0; font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.kpi__v { margin: 4px 0 2px; font-family: var(--f-body); font-weight: 700; font-size: 1.55rem; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi__s { margin: 0; font-size: 0.8rem; color: var(--muted); }
.kpi.warn { border-color: rgba(242, 165, 30, 0.7); background: #fffaf0; }

/* needs-you-now list */
.att-list { display: grid; gap: 8px; }
.att { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font: inherit; color: inherit; text-align: left; cursor: pointer; margin: 0; }
.att .ic { width: 22px; height: 22px; color: var(--chili); flex: none; }
.att b { font-size: 1.2rem; min-width: 1.4em; }
.att__go { margin-left: auto; font-size: 1.4rem; color: var(--muted); }
.att--ok { cursor: default; color: var(--leaf); font-weight: 600; }
.att--ok .ic { color: var(--leaf); }

/* quick actions */
.qa-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.qa { display: grid; gap: 4px; align-content: start; text-align: left; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: #fff; font: inherit; color: inherit; cursor: pointer; min-height: 112px; transition: transform 0.15s var(--ease), border-color 0.15s; }
.qa:hover { border-color: var(--ink); }
.qa:active { transform: scale(0.98); }
.qa__ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--paper); margin-bottom: 4px; }
.qa__ic .ic { width: 22px; height: 22px; }
.qa b { line-height: 1.25; }
.qa small { color: var(--muted); font-size: 0.8rem; }
.qa--hot { border-color: var(--haldi); background: #fffaf0; }
.qa--hot .qa__ic { background: var(--haldi); }

/* column chart (single series) */
.cc { position: relative; }
.cc svg { width: 100%; height: auto; display: block; overflow: visible; }
.cc__grid { stroke: rgba(42, 20, 13, 0.1); stroke-width: 1; }
.cc__y, .cc__x { font: 500 11px var(--f-body); fill: var(--muted); }
.cc__y { text-anchor: end; }
.cc__x { text-anchor: middle; }
.cc__bar { fill: #c8372b; }
.cc__hit { fill: transparent; cursor: pointer; }
.cc__col.is-on .cc__hit { fill: rgba(42, 20, 13, 0.05); }
.cc__tip { position: absolute; top: -6px; width: 150px; padding: 8px 10px; border-radius: 10px; background: var(--ink); color: #fff6e8; font-size: 0.8rem; line-height: 1.35; pointer-events: none; text-align: center; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.5); }

/* ---------- counter (POS) ---------- */
.pos__grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.pos__left { min-width: 0; } /* lets the chip row scroll instead of widening the page */
.pos__cats { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.pos__cats button { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: 600 0.88rem var(--f-body); cursor: pointer; color: var(--ink); }
.pos__cats button.is-on { background: var(--ink); color: #fff6e8; border-color: var(--ink); }
.pos__items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pit { position: relative; display: grid; gap: 2px; align-content: start; text-align: left; min-height: 96px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font: inherit; color: inherit; cursor: pointer; transition: transform 0.12s var(--ease), border-color 0.12s; -webkit-tap-highlight-color: transparent; }
.pit:active { transform: scale(0.97); }
.pit.is-in { border-color: var(--leaf); box-shadow: 0 0 0 1px var(--leaf) inset; }
.pit.is-out { opacity: 0.55; }
.pit__n { font-weight: 700; line-height: 1.25; font-size: 0.95rem; }
.pit__g { font-size: 0.8rem; color: var(--muted); }
.pit__s { font-size: 0.78rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pit__p { margin-top: auto; padding-top: 6px; font-weight: 700; }
.pit__p em { font-style: normal; font-size: 0.7rem; color: var(--chili); font-weight: 600; }
.pit__q { position: absolute; top: 8px; right: 8px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--leaf); color: #fff; font-size: 0.8rem; font-weight: 700; display: grid; place-items: center; }
.pit--custom { border-style: dashed; background: transparent; }
.pos__ticket { position: sticky; top: 76px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px 16px; display: grid; gap: 12px; max-height: calc(100dvh - 96px); overflow-y: auto; }
.tk__head { display: flex; align-items: center; gap: 8px; }
.tk__head h3 { font-size: 1.3rem; margin-right: auto; }
.tk__back { display: none; }
.tk__lines { list-style: none; margin: 0; padding: 0; display: grid; }
.tk__lines li { display: grid; grid-template-columns: 1fr auto 64px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.tk__lines li b { text-align: right; font-variant-numeric: tabular-nums; }
.tk__n { font-weight: 600; line-height: 1.25; font-size: 0.92rem; }
.tk__n small { color: var(--muted); font-weight: 500; }
.tk__each { display: block; font-size: 0.75rem; }
.tk__lines .qty { display: flex; align-items: center; gap: 6px; }
.tk__lines .qty button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); font: 700 1.05rem var(--f-body); cursor: pointer; }
.tk__empty { color: var(--muted); text-align: center; padding: 18px 0; margin: 0; }
.tk__opts { display: grid; gap: 8px; }
.tk__opts > label { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-top: 4px; }
.tk__opts input:not([type="checkbox"]) { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font: inherit; }
.seg--sm button { padding: 9px 6px; font-size: 0.88rem; }
.tk__given { font-size: 0.9rem !important; font-weight: 600 !important; color: var(--ink) !important; }
.tk__disc { display: grid; gap: 4px; }
.tk__tot { border-top: 1px solid var(--line); padding-top: 8px; }
.tk__tot p { display: flex; justify-content: space-between; margin: 2px 0; color: var(--muted); font-size: 0.9rem; }
.tk__tot .tk__grand { color: var(--ink); font-size: 1rem; }
.tk__grand b { font-family: var(--f-display); font-size: 1.6rem; }
.pos__bar { display: none; }
.pay-box { text-align: center; margin: 4px 0 14px; padding: 12px; border-radius: 14px; background: #fff8e6; border: 1px solid #f2d28a; }
.pay-box p { margin: 0 0 8px; }
.pay-box__qr { width: 210px; margin: 0 auto; background: #fff; padding: 8px; border-radius: 12px; }
.pay-box__qr svg { display: block; width: 100%; height: auto; }
.pill--ch { background: rgba(43, 108, 176, 0.12); color: #2b6cb0; }

/* ---------- income ---------- */
.inc__ranges { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.inc__ranges .seg { flex: 1 1 auto; }
.inc__custom { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; color: var(--muted); }
.inc__custom input { padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font: inherit; color: var(--ink); }
#incBody { transition: opacity 0.2s; }
#incBody.is-loading { opacity: 0.45; }
.inc__two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.inc__two .card-box { margin-top: 16px; }
.split__bar { display: flex; gap: 2px; height: 22px; border-radius: 6px; overflow: hidden; background: #fff; }
.split__on { background: #c8372b; min-width: 4px; }
.split__off { background: #2b6cb0; min-width: 4px; }
.split__legend { display: grid; gap: 6px; margin-top: 10px; }
.split__legend p { margin: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 0.92rem; }
.split__legend small { color: var(--muted); }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none; align-self: center; }
.sw--on { background: #c8372b; }
.sw--off { background: #2b6cb0; }
.ctab { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-bottom: 12px; }
.ctab th { text-align: left; font-size: 0.75rem; color: var(--muted); font-weight: 600; padding: 4px 0; border-bottom: 1px solid var(--line); }
.ctab td { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.ctab th:not(:first-child), .ctab td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.ctab__note { font-size: 0.75rem !important; margin: -6px 0 0 !important; }
.hb { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 0.9rem; }
.hb__n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb__track { height: 10px; }
.hb__bar { display: block; height: 10px; background: #c8372b; border-radius: 0 4px 4px 0; min-width: 3px; }
.hb__v { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.hb__v b { color: var(--ink); }
.inc__tablehead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.otable-wrap { overflow-x: auto; margin-top: 10px; }
.otable { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 560px; }
.otable th { text-align: left; font-size: 0.75rem; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.otable td { padding: 9px 8px; border-bottom: 1px dashed var(--line); }
.otable tbody tr { cursor: pointer; }
.otable tbody tr:hover { background: var(--paper); }
.otable tr.is-off td { color: var(--muted); text-decoration: line-through; }
.otable .r { text-align: right; font-variant-numeric: tabular-nums; }
.pp { font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.pp--ok { background: rgba(47, 107, 53, 0.12); color: var(--leaf); }
.pp--due { background: rgba(242, 165, 30, 0.22); color: var(--maroon); }

/* ---------- computer: sidebar ---------- */
@media (min-width: 900px) {
  .app { max-width: 1240px; display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: auto auto 1fr; padding-bottom: 40px; }
  .topbar, .demo-bar { grid-column: 1 / -1; }
  .tabs { grid-column: 1; grid-row: 3; flex-direction: column; position: sticky; top: 76px; align-self: start; padding: 18px 12px; gap: 4px; overflow: visible; }
  .tabs button { width: 100%; justify-content: flex-start; padding: 11px 14px; border-radius: 14px; }
  .tabs .tab--new { order: -1; margin-bottom: 8px; justify-content: center; }
  .panes { grid-column: 2; grid-row: 3; padding: 10px 24px 0 8px; }
  .olist { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
}
/* tablet */
@media (min-width: 641px) and (max-width: 899px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qa-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pos__grid { grid-template-columns: minmax(0, 1fr) 300px; }
}
/* ---------- phone ---------- */
@media (max-width: 640px) {
  .tabs .tab--more { display: none; }
  .tabs .tab-more-btn { display: flex; }
  .tabs { overflow: visible; }
  .tabs .tab--new { background: var(--haldi) !important; color: var(--ink) !important; }
  .tabs .tab--new .tab__l { font-size: 0.68rem; }
  .more-menu:not([hidden]) { display: grid; position: fixed; z-index: 45; right: 10px; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 76px); width: min(260px, calc(100% - 20px)); padding: 8px; border-radius: 18px; background: #fffdf8; border: 1px solid var(--line); box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.45); gap: 2px; animation: pop 0.25s var(--ease); }
  .more-menu button, .more-menu a { display: flex; align-items: center; gap: 12px; padding: 13px 12px; border-radius: 12px; border: 0; background: transparent; font: 600 0.98rem var(--f-body); color: var(--ink); text-decoration: none; text-align: left; cursor: pointer; }
  .more-menu button:active, .more-menu a:active { background: var(--paper); }
  .more-menu .ic { width: 22px; height: 22px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; }
  .kpi__v { font-size: 1.25rem; }
  .qa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qa { min-height: 104px; }
  .inc__two { grid-template-columns: 1fr; }
  .inc__ranges .seg { width: 100%; }
  .inc__custom { width: 100%; }
  .inc__custom input { flex: 1; min-width: 0; }
  /* counter: items full screen, ticket slides up */
  .pos__grid { grid-template-columns: 1fr; }
  .pos__items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos__ticket { display: none; }
  .pos.show-ticket .pos__ticket { display: grid; position: fixed; inset: auto 0 0 0; top: auto; z-index: 46; max-height: 92dvh; border-radius: 24px 24px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, 0.5); animation: rise 0.3s var(--ease); }
  .pos.show-ticket::before { content: ""; position: fixed; inset: 0; z-index: 45; background: rgba(29, 13, 8, 0.4); }
  .tk__back { display: inline; }
  .pos__bar:not([hidden]) { display: flex; position: fixed; z-index: 41; left: 10px; right: 10px; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 76px); justify-content: space-between; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 16px; background: var(--ink); color: #fff6e8; box-shadow: 0 16px 34px -14px rgba(0, 0, 0, 0.6); }
  .pos { padding-bottom: 70px; }
  .tk__lines li { grid-template-columns: 1fr auto 58px; }
}
