/* Luban POS — "ledger & thermal receipt": warm paper, ink, frankincense-green, saffron.
   Static demo build: no web fonts (system fallbacks below), plus a slim fixed demo banner. */
:root {
  --paper: #ece3d0;
  --paper-2: #f6f0e1;
  --card: #fbf7ec;
  --ink: #1d1a15;
  --ink-2: #4a443a;
  --muted: #877f6e;
  --line: #d8cdb4;
  --line-2: #e6dcc6;
  --green: #1c6a4f;
  --green-d: #134e3a;
  --green-l: #dcebe2;
  --saffron: #e2a62b;
  --saffron-l: #f7e6bb;
  --red: #b3341f;
  --red-l: #f5d9d2;
  --blue: #2f5d8a;
  --blue-l: #d9e5f1;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(29, 26, 21, .05), 0 8px 24px -12px rgba(29, 26, 21, .25);
  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --body: 'Hanken Grotesk', ui-sans-serif, 'Segoe UI', system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --bar-h: 34px; /* demo banner */
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 500 15px/1.45 var(--body);
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3  0 0 0 0 .25  0 0 0 0 .15  0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
  padding-top: var(--bar-h);
}
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 2rem; line-height: 1.1; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-feature-settings: 'tnum'; }
.strong { font-weight: 700; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .88rem; }
.ico { flex: none; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 92px 1fr; height: calc(100dvh - var(--bar-h)); }
.rail {
  background: var(--ink); color: #e9e1cd; display: flex; flex-direction: column; align-items: center;
  padding: 18px 0; gap: 10px; position: relative; z-index: 5;
}
.rail-logo {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px;
  background: var(--saffron); color: var(--ink); font: 700 1.6rem/1 var(--display);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15);
}
.rail-items { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 0 10px; flex: 1; }
.rail-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; width: 100%;
  border-radius: 12px; color: #b8af99; text-decoration: none; font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  background: none; border: 0; position: relative; transition: background .15s, color .15s;
}
.rail-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.rail-item.active { background: rgba(255, 255, 255, .1); color: #fff; }
.rail-item.active::before {
  content: ''; position: absolute; left: -10px; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--saffron);
}
.rail-user { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding: 0 10px; }
.who { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: #3a342a; color: var(--saffron); font: 700 .9rem var(--display); border: 2px solid #4a4336;
}
#view { overflow: auto; padding: 28px 32px 40px; min-width: 0; outline: none; }
.view-enter { animation: rise .35s cubic-bezier(.2, .7, .2, 1) backwards; } /* not "both": a lingering transform would trap the fixed mobile cart inside #view */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.loading { color: var(--muted); padding: 40px 0; }

/* ---------- role / status chips ---------- */
.role {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
}
.role-owner { background: var(--saffron); color: #3a2a00; }
.role-cashier { background: var(--green-l); color: var(--green-d); }
.role-viewer { background: var(--blue-l); color: var(--blue); }
.rail .role-owner { background: var(--saffron); }
.rail .role-cashier { background: #2c4d3f; color: #bfe6d1; }
.rail .role-viewer { background: #2b4258; color: #bcd6ee; }
.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--line-2); color: var(--ink-2); white-space: nowrap;
}
.pill::first-letter { text-transform: uppercase; }
.st-completed, .st-ok { background: var(--green-l); color: var(--green-d); }
.st-refunded, .st-out { background: var(--red-l); color: var(--red); }
.st-low { background: var(--saffron-l); color: #7a5600; }
.pay-cash { background: var(--saffron-l); color: #7a5600; }
.pay-card { background: var(--blue-l); color: var(--blue); }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 12px;
  border: 1.5px solid var(--ink); background: var(--card); font-weight: 700; transition: transform .08s, background .15s, box-shadow .15s;
  box-shadow: 0 3px 0 var(--ink);
}
.btn:hover:not(:disabled) { background: #fff; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn.primary { background: var(--green); color: #fff; border-color: var(--green-d); box-shadow: 0 3px 0 var(--green-d); }
.btn.primary:hover:not(:disabled) { background: #22795b; }
.btn.danger { background: var(--red); color: #fff; border-color: #7e2212; box-shadow: 0 3px 0 #7e2212; }
.btn.danger-ghost { color: var(--red); border-color: var(--red); box-shadow: 0 3px 0 var(--red); }
.btn.big { padding: 15px 22px; font-size: 1.05rem; border-radius: 14px; }
.btn.full { width: 100%; }
.mini {
  padding: 5px 11px; border-radius: 9px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; font-size: .82rem;
  font-family: var(--mono); transition: all .12s;
}
.mini:hover { border-color: var(--ink); }
.mini.on { background: var(--ink); color: var(--paper-2); border-color: var(--ink); }
.link { background: none; border: 0; color: var(--red); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 4px; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 10px; color: var(--ink-2); display: grid; place-items: center; }
.icon-btn:hover { background: var(--line-2); }

input, select, textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 11px; background: var(--paper-2);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(28, 106, 79, .15); background: #fff; }
label { display: block; font-size: .82rem; font-weight: 700; color: var(--ink-2); }
label > input, label > select { margin-top: 6px; font-weight: 500; font-size: 1rem; }
.check { display: flex; align-items: center; gap: 10px; font-size: .95rem; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--green); }
.form-error { color: var(--red); font-weight: 600; min-height: 1.2em; font-size: .9rem; }
.stack { display: grid; gap: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.search { position: relative; display: block; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 38px; margin: 0; min-width: 240px; }

/* ---------- page chrome ---------- */
.page { max-width: 1280px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.sub { color: var(--muted); margin-top: 4px; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters select { width: auto; margin: 0; }
.card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.card-head.sp { margin-top: 24px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty.small { padding: 36px 20px; }
.more { text-align: center; margin-top: 16px; }

/* tables */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
  padding: 13px 16px; border-bottom: 1.5px solid var(--line); white-space: nowrap; background: var(--paper-2);
}
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl td { white-space: nowrap; }
.tbl td:first-child { white-space: normal; min-width: 150px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; }
.tbl.clickable tbody tr { cursor: pointer; }
.tbl.clickable tbody tr:hover, .tbl.clickable tbody tr:focus-visible { background: var(--paper-2); }
.tbl tr.inactive td { opacity: .55; }
.tbl .actions { white-space: nowrap; }
.tbl .actions .mini + .mini { margin-left: 6px; }
.emo { font-size: 1.25rem; margin-right: 6px; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: 22px; height: calc(100dvh - var(--bar-h) - 68px); }
.pos-main { display: flex; flex-direction: column; min-height: 0; }
.pos .page-head { margin-bottom: 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; font-size: .9rem;
  transition: all .15s;
}
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); color: var(--paper-2); border-color: var(--ink); }
.grid {
  flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; align-content: start; padding: 4px 4px 24px 2px; margin: 0 -4px 0 -2px;
}
.tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 14px 14px 12px; min-height: 138px; border-radius: 16px; background: var(--card); border: 1.5px solid var(--line);
  box-shadow: 0 3px 0 var(--line); transition: transform .1s, box-shadow .1s, border-color .15s;
  animation: pop .35s cubic-bezier(.2, .8, .3, 1) both; animation-delay: calc(var(--i, 0) * 18ms);
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.tile:hover:not(:disabled) { border-color: var(--green); box-shadow: 0 3px 0 var(--green); transform: translateY(-2px); }
.tile:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 0 0 var(--green); }
.tile-emoji { font-size: 2.3rem; line-height: 1.1; margin-bottom: 6px; }
.tile-name { font-weight: 700; line-height: 1.2; flex: 1; }
.tile-price { font-family: var(--mono); font-size: .95rem; color: var(--green-d); font-weight: 500; }
.tile-qty {
  position: absolute; top: 10px; right: 10px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px;
  background: var(--green); color: #fff; font: 600 .85rem/26px var(--mono); text-align: center; animation: bump .25s;
}
@keyframes bump { 50% { transform: scale(1.3); } }
.tile-flag { position: absolute; top: 12px; right: 12px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--red); }
.tile-flag.warn { color: #9a6c00; }
.tile-qty ~ .tile-flag { top: 42px; }
.tile.out { opacity: .55; background: var(--paper-2); }
.tile.low { border-color: #e7c874; }

.cart { min-height: 0; display: flex; }
.receipt-card {
  flex: 1; display: flex; flex-direction: column; min-height: 0; background: #fffdf6; border-radius: 16px 16px 6px 6px;
  border: 1.5px solid var(--line); box-shadow: var(--shadow); position: relative;
}
.receipt-card::after { /* torn thermal-paper edge */
  content: ''; position: absolute; left: -1.5px; right: -1.5px; bottom: -9px; height: 10px; background:
    linear-gradient(135deg, #fffdf6 50%, transparent 50%) 0 0 / 14px 10px repeat-x,
    linear-gradient(225deg, #fffdf6 50%, transparent 50%) 0 0 / 14px 10px repeat-x;
  filter: drop-shadow(0 2px 0 var(--line));
}
.cart-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 12px; border-bottom: 2px dashed var(--line); }
.cart-lines { flex: 1; overflow-y: auto; padding: 6px 12px; min-height: 120px; }
.cart-line { display: grid; grid-template-columns: 34px 1fr auto 74px; gap: 8px; align-items: center; padding: 10px 8px; border-bottom: 1px dotted var(--line); }
.cl-emoji { font-size: 1.5rem; text-align: center; }
.cl-name { font-weight: 700; line-height: 1.2; }
.cl-unit { font: 400 .75rem var(--mono); color: var(--muted); }
.cl-total { text-align: right; font-family: var(--mono); font-weight: 500; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.stepper button { width: 30px; height: 32px; border: 0; background: none; display: grid; place-items: center; }
.stepper button:hover:not(:disabled) { background: var(--green-l); }
.stepper span { min-width: 26px; text-align: center; font: 500 .95rem var(--mono); }
.cart-empty { text-align: center; color: var(--muted); padding: 34px 10px; }
.cart-empty-ico { font-size: 2.6rem; filter: grayscale(.4); margin-bottom: 6px; }
.cart-foot { padding: 14px 20px 22px; border-top: 2px dashed var(--line); display: grid; gap: 7px; }
.disc { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.disc-label { font-weight: 700; font-size: .85rem; white-space: nowrap; }
.disc-label small { color: var(--muted); font-weight: 500; }
.disc-chips { display: flex; gap: 5px; align-items: center; }
.disc-input { width: 64px; padding: 5px 7px; margin: 0; font: 500 .85rem var(--mono); border-radius: 9px; }
.tot-row { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .92rem; }
.tot-row.muted { color: var(--muted); font-size: .8rem; }
.tot-row.disc-row { color: var(--green-d); }
.tot-row.grand { font: 700 1.55rem var(--display); margin: 6px 0 8px; padding-top: 8px; border-top: 2px solid var(--ink); }
.cart-fab { display: none; }
.cart-head-actions { display: flex; align-items: center; gap: 6px; }
.cart-hide { display: none; color: var(--ink-2); }

/* ---------- modal ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background: rgba(29, 26, 21, .55); backdrop-filter: blur(3px); animation: fade .15s both;
}
.backdrop.out { opacity: 0; transition: opacity .15s; }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(440px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; background: var(--card); border-radius: 18px;
  border: 1.5px solid var(--ink); padding: 22px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); animation: modal-in .22s cubic-bezier(.2, .9, .3, 1.1) both;
}
.modal.wide { width: min(640px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.modal-actions .btn { flex: 0 0 auto; }

.pay { display: grid; gap: 14px; }
.pay-total { font: 700 3rem/1 var(--display); text-align: center; padding: 8px 0 2px; }
.pay-total span { font: 500 1rem var(--mono); color: var(--muted); margin-right: 4px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 13px; background: var(--line-2); gap: 4px; }
.seg button { padding: 10px 14px; border: 0; background: none; border-radius: 10px; font-weight: 700; color: var(--ink-2); }
.seg button.on { background: var(--ink); color: var(--paper-2); }
.seg.small { grid-auto-columns: auto; }
.seg.small button { padding: 7px 14px; font-size: .88rem; }
#tender { font: 500 1.8rem var(--mono); text-align: right; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.change { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--paper-2); text-align: center; min-height: 48px; color: var(--ink-2); }
.change.ok { background: var(--green-l); color: var(--green-d); font-size: 1.1rem; }
.change b { font-family: var(--mono); font-size: 1.25rem; }

/* receipt paper (shared by checkout, orders, print) */
.paper-receipt {
  position: relative; margin: 14px auto 26px; padding: 22px 22px 26px; max-width: 360px; background: #fffdf6; border: 1px solid var(--line);
  font: 400 .85rem/1.55 var(--mono); color: #26221b;
}
.paper-receipt::after {
  content: ''; position: absolute; left: -1px; right: -1px; bottom: -9px; height: 10px; background:
    linear-gradient(135deg, #fffdf6 50%, transparent 50%) 0 0 / 14px 10px repeat-x, linear-gradient(225deg, #fffdf6 50%, transparent 50%) 0 0 / 14px 10px repeat-x;
}
.paper-receipt hr { border: 0; border-top: 1.5px dashed #b9ad92; margin: 10px 0; }
.r-brand { font: 700 1.4rem var(--display); text-align: center; }
.r-sub { text-align: center; color: var(--muted); font-size: .75rem; }
.r-meta { display: grid; gap: 0; margin-top: 10px; font-size: .78rem; color: var(--ink-2); }
.r-line, .r-row { display: flex; justify-content: space-between; gap: 12px; }
.r-note { color: var(--muted); font-size: .75rem; padding-left: 14px; }
.r-total { font-weight: 500; font-size: 1.05rem; margin-top: 4px; }
.r-thanks { text-align: center; margin-top: 14px; color: var(--ink-2); }
.r-stamp {
  position: absolute; right: 18px; top: 74px; transform: rotate(-12deg); border: 3px solid var(--red); color: var(--red);
  padding: 2px 10px; font: 700 1.1rem var(--display); letter-spacing: .12em; opacity: .85; border-radius: 6px;
}
.receipt-modal { display: grid; }
.receipt-modal .modal-actions { justify-content: center; margin-top: 16px; }
.done-badge { text-align: center; padding: 10px; border-radius: 12px; background: var(--green-l); color: var(--green-d); font-weight: 700; }
.refund-form { display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1.5px solid var(--line); }

/* ---------- reports ---------- */
.kpis { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.kpi { display: grid; gap: 4px; padding: 18px 20px; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi.hero { background: var(--ink); color: var(--paper-2); border-color: var(--ink); position: relative; overflow: hidden; }
.kpi.hero::after { content: ''; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: var(--saffron); opacity: .9; }
.kpi-l { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); position: relative; z-index: 1; }
.kpi.hero .kpi-l { color: #b8af99; }
.kpi-v { font: 700 1.7rem/1.15 var(--display); position: relative; z-index: 1; }
.kpi.hero .kpi-v { font-size: 2.2rem; }
.kpi-s { color: var(--muted); font-size: .85rem; position: relative; z-index: 1; }
.kpi.hero .kpi-s { color: #cfc6af; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; align-items: start; }
.span-2 { grid-column: span 2; }
.grid-2 > .card:not(.span-2) { min-width: 0; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 230px; padding-top: 14px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.bar-track { flex: 1; width: 100%; min-height: 0; display: flex; align-items: flex-end; justify-content: center; }
.bar { width: 100%; max-width: 54px; background: var(--line); border-radius: 8px 8px 3px 3px; transition: height .6s cubic-bezier(.2, .8, .2, 1), background .15s; transform-origin: bottom; animation: grow .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes grow { from { transform: scaleY(0); } }
.bar-col:hover .bar { background: var(--green); }
.bar-col.today .bar { background: var(--saffron); }
.bar-col.today:hover .bar { background: #c88d10; }
.bar-val { font: 400 .72rem var(--mono); color: var(--muted); height: 1.1em; }
.bar-lbl { font-size: .7rem; color: var(--muted); white-space: nowrap; font-weight: 600; }
.bars.dense { gap: 4px; }
.bars.dense .bar-val { display: none; }
.bars.dense .bar-lbl { writing-mode: vertical-rl; transform: rotate(180deg); font-size: .62rem; height: 3.4em; }
.rank { display: grid; grid-template-columns: minmax(120px, 1.2fr) 1.4fr 36px; gap: 10px; align-items: center; padding: 6px 0; font-size: .92rem; }
.rank b { text-align: right; font-family: var(--mono); font-weight: 500; }
.rank-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar { height: 9px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--green); border-radius: 5px; }
.rank-bar.alt i { background: var(--saffron); }
.split { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: var(--line-2); }
.split i.cash { background: var(--saffron); }
.split i.card { background: var(--blue); }
.legend { display: grid; gap: 6px; margin-top: 12px; font-size: .92rem; }
.legend b { font-family: var(--mono); font-weight: 500; margin-left: 4px; }
.legend small { color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.dot.cash { background: var(--saffron); } .dot.card { background: var(--blue); }
.low-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px dotted var(--line); }
.low-row:last-child { border: 0; }

/* users */
.role-help { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.role-help p { color: var(--ink-2); margin-top: 8px; font-size: .9rem; }
.audit { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.audit li { display: grid; grid-template-columns: 150px 140px 150px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px dotted var(--line); font-size: .85rem; align-items: baseline; }
.audit time { color: var(--muted); font-family: var(--mono); font-size: .78rem; }
.audit code { font: 500 .78rem var(--mono); background: var(--line-2); padding: 1px 7px; border-radius: 6px; width: max-content; }

/* toasts */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(440px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--paper-2); font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); animation: rise .25s both; }
.toast-ok { background: var(--green-d); }
.toast-error { background: var(--red); }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .25s; }

/* ---------- login ---------- */
.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: calc(100dvh - var(--bar-h)); }
.login-art {
  background: var(--ink); color: var(--paper-2); padding: 7vw 6vw; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center;
}
.login-art h1 { font-size: clamp(3rem, 6vw, 5.4rem); line-height: .95; font-weight: 700; position: relative; z-index: 1; }
.login-art h1 em { font-style: italic; font-weight: 500; color: var(--saffron); font-size: .55em; }
.login-art p { margin-top: 18px; text-transform: uppercase; letter-spacing: .3em; font-size: .78rem; color: #b8af99; position: relative; z-index: 1; }
.login-receipt {
  margin-top: 54px; width: 260px; padding: 16px 18px; background: #fffdf6; color: #26221b; font: 400 .8rem/1.7 var(--mono);
  transform: rotate(-3deg); position: relative; z-index: 1; box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .6);
  animation: print-in 1.1s cubic-bezier(.2, .8, .2, 1) .2s both;
}
.login-receipt::after { content: ''; position: absolute; left: 0; right: 0; bottom: -9px; height: 10px; background: linear-gradient(135deg, #fffdf6 50%, transparent 50%) 0 0 / 14px 10px repeat-x, linear-gradient(225deg, #fffdf6 50%, transparent 50%) 0 0 / 14px 10px repeat-x; }
.login-receipt div { display: flex; justify-content: space-between; }
.login-receipt .sep { border-top: 1.5px dashed #b9ad92; margin: 4px 0; display: block; }
@keyframes print-in { from { clip-path: inset(0 0 100% 0); transform: translateY(-30px) rotate(-3deg); } }
.steam { position: absolute; right: 8%; top: 12%; width: 220px; height: 300px; pointer-events: none; }
.steam::before, .steam::after {
  content: ''; position: absolute; bottom: 0; left: 40%; width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 166, 43, .35), transparent 70%); filter: blur(14px); animation: steam 6s ease-in infinite;
}
.steam::after { left: 10%; animation-delay: 2.5s; width: 70px; height: 70px; }
@keyframes steam { 0% { transform: translateY(0) scale(.8); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-260px) scale(2); opacity: 0; } }
.login-panel { display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: 5vw 6vw; max-width: 560px; width: 100%; margin: 0 auto; }
.login-intro { display: grid; gap: 8px; }
.login-panel h2 { font-size: 2rem; }
.demo-box { border: 1.5px dashed var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 8px; background: rgba(251, 247, 236, .6); }
.demo-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--muted); }
.demo-title span { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 6px; }
.demo-acct {
  display: grid; grid-template-columns: 78px 1fr; gap: 2px 10px; align-items: center; text-align: left; padding: 10px 12px;
  border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); transition: all .15s;
}
.demo-acct:hover { border-color: var(--green); transform: translateX(3px); }
.demo-acct .role { grid-row: span 2; text-align: center; }
.demo-name { font-weight: 700; }
.demo-blurb { color: var(--muted); font-size: .8rem; grid-column: 2; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .pos { grid-template-columns: minmax(0, 1fr) 360px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .audit li { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr 66px; }
  .rail { order: 2; flex-direction: row; padding: 4px 8px; gap: 4px; }
  .rail-logo, .rail-user .role { display: none; }
  .rail-items { flex-direction: row; padding: 0; justify-content: space-around; }
  .rail-item { padding: 6px 2px; font-size: .66rem; }
  .rail-item.active::before { left: 25%; right: 25%; top: -4px; bottom: auto; width: auto; height: 4px; border-radius: 0 0 4px 4px; }
  .rail-user { flex-direction: row; width: auto; padding: 0; }
  .who { display: none; }
  #view { padding: 18px 16px 90px; }
  h1 { font-size: 1.6rem; }
  .pos { grid-template-columns: 1fr; height: calc(100dvh - var(--bar-h) - 66px - 36px); }
  .cart { position: fixed; inset: var(--bar-h) 0 66px 0; z-index: 30; background: var(--paper); padding: 16px; transform: translateY(calc(100% + 66px)); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
  .cart.open { transform: none; }
  .receipt-card { margin-bottom: 12px; min-width: 0; }
  .disc { flex-wrap: wrap; }
  .cart-hide { display: inline; }
  .cart-fab {
    display: flex; align-items: center; gap: 10px; position: fixed; left: 16px; right: 16px; bottom: 80px; z-index: 20; padding: 14px 18px;
    border-radius: 16px; border: 1.5px solid var(--green-d); background: var(--green); color: #fff; font-weight: 700; box-shadow: 0 6px 0 var(--green-d), 0 18px 30px -10px rgba(0, 0, 0, .4);
  }
  .cart-fab b { margin-left: auto; font-family: var(--mono); }
  .search input { min-width: 0; width: 100%; }
  .search { flex: 1; }
  .grid-2, .role-help { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 36px 24px; min-height: 280px; }
  .login-receipt { display: none; }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- demo banner ---------- */
.demo-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px;
  background: #2a251d; color: #b8af99; border-bottom: 1px solid #3a342a; font-size: .8rem; line-height: 1;
}
.demo-bar-msg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.demo-bar-msg b { color: var(--saffron); font-weight: 700; letter-spacing: .02em; }
.demo-bar-actions { display: flex; align-items: center; gap: 14px; flex: none; }
.demo-bar-btn {
  background: none; border: 1px solid #4a4336; color: #e9e1cd; border-radius: 8px; padding: 4px 10px; font-size: .76rem; font-weight: 700;
  transition: border-color .15s, color .15s;
}
.demo-bar-btn:hover { border-color: var(--saffron); color: #fff; }
.demo-bar-link { color: #e9e1cd; text-decoration: none; font-weight: 600; white-space: nowrap; }
.demo-bar-link:hover { color: var(--saffron); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 560px) {
  .demo-bar { padding: 0 10px; gap: 8px; font-size: .74rem; }
  .demo-bar-sep { display: none; }
  .demo-bar-actions { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
}

/* ---------- print: only the receipt ---------- */
@media print {
  body { background: #fff; padding-top: 0; }
  #app, #toasts, .demo-bar, .no-print { display: none !important; }
  .backdrop { position: static; background: none; padding: 0; backdrop-filter: none; display: block; }
  .modal { border: 0; box-shadow: none; padding: 0; max-height: none; width: 80mm; animation: none; }
  .paper-receipt { border: 0; margin: 0; max-width: none; }
  .paper-receipt::after { display: none; }
}
