/* ─────────────  demo overlay  ───────────── */

.dm {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 20px;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}
.dm.on { display: flex; }
.dm-back { position: absolute; inset: 0; background: rgba(2, 5, 8, .82); backdrop-filter: blur(6px); }
.dm-win {
  position: relative; width: min(1440px, 100%); height: min(920px, 100%);
  background: var(--bg2); border: 1px solid var(--line2); border-radius: 18px;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .9);
  display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); overflow: hidden;
}

/* topbar */
.dm-top {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; padding: 10px 14px;
  background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0;
}
.dm-brand { display: flex; align-items: center; gap: 10px; }
.dm-logo { width: 10px; height: 10px; border-radius: 3px; background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.dm-ttl { font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; white-space: nowrap; }
.dm-chip {
  font-size: 11px; color: var(--dim); border: 1px solid var(--line2);
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
@media (max-width: 1150px) { .dm-chip { display: none; } }
.dm-roles {
  display: flex; gap: 4px; margin-inline: auto; background: var(--bg);
  padding: 4px; border-radius: 12px; border: 1px solid var(--line);
  min-width: 0; overflow-x: auto; scrollbar-width: none;
}
.dm-roles::-webkit-scrollbar { display: none; }
.dm-kasa, .dm-office, .dm-kds, .dm-del { min-width: 0; }
.dm-roles button {
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted);
  background: transparent; border: 0; border-radius: 9px; padding: 7px 16px; cursor: pointer;
  transition: background .2s, color .2s;
}
.dm-roles button:hover { color: var(--text); }
.dm-roles button.on { background: var(--panel2); color: var(--accent); box-shadow: inset 0 0 0 1px var(--line2); }
.dm-top-r { display: flex; align-items: center; gap: 8px; }
.dm-online {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px;
  color: var(--muted); white-space: nowrap; padding: 6px 4px;
}
.dm-online i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.dm-pill {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; margin-left: 7px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center; vertical-align: middle;
}
.dm-icobtn {
  font: inherit; font-size: 12.5px; background: transparent; border: 1px solid var(--line2);
  color: var(--muted); border-radius: 10px; padding: 6px 12px; cursor: pointer; white-space: nowrap;
}
.dm-icobtn:hover { color: var(--text); border-color: var(--line2); }
.dm-x { font-size: 15px; padding: 5px 11px; }

.dm-body { overflow: auto; background: var(--bg2); min-width: 0; }

/* buttons in demo */
.dm-btn {
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  background: var(--panel2); color: var(--text); border: 1px solid var(--line2);
  border-radius: 10px; padding: 9px 14px; transition: border-color .18s, background .18s, opacity .18s;
}
.dm-btn:hover:not(:disabled) { border-color: var(--accent2); }
.dm-btn:disabled { opacity: .35; cursor: not-allowed; }
.dm-btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #05130b; border-color: transparent; }
.dm-btn.warn { border-color: rgba(229, 169, 60, .5); color: var(--warn); }
.dm-btn.sm { font-size: 12px; padding: 6px 11px; border-radius: 8px; }
.dm-btn.lg { font-size: 15px; padding: 13px 24px; }
.dm-btn.full { width: 100%; }

.dm-muted { color: var(--dim); font-size: 13.5px; }
.dm-muted.sm { font-size: 12px; }

/* empty states */
.dm-empty {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 40px;
}
.dm-empty-ico { font-size: 42px; color: var(--line2); }
.dm-empty h3 { font-size: 20px; }
.dm-empty p { color: var(--muted); max-width: 46ch; }
.dm-tour { list-style: none; counter-reset: s; display: grid; gap: 8px; margin-top: 18px; text-align: left; }
.dm-tour li { counter-increment: s; color: var(--dim); font-size: 13px; position: relative; padding-left: 30px; }
.dm-tour li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 20px; height: 20px;
  border-radius: 6px; background: var(--panel2); border: 1px solid var(--line2);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--accent);
}

/* ─────────────  KASA  ───────────── */
.dm-kasa { display: grid; grid-template-columns: 268px 1fr 348px; height: 100%; }
.dm-col { overflow-y: auto; padding: 14px; }
.dm-col.plan { border-right: 1px solid var(--line); background: var(--bg); }
.dm-col.check {
  border-left: 1px solid var(--line); background: var(--bg);
  display: flex; flex-direction: column; align-content: start;
}
.dm-col.check > * { flex-shrink: 0; }

.dm-daybar {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
}
.dm-daybar b { font-size: 13px; display: block; }
.dm-daybar i { font-style: normal; font-size: 11.5px; color: var(--dim); }
.dm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

.dm-zone + .dm-zone { margin-top: 16px; }
.dm-zone h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--dim); margin-bottom: 8px; font-weight: 700;
}
.dm-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dm-table {
  position: relative; aspect-ratio: 1.15; border-radius: 11px; cursor: pointer;
  background: var(--panel2); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font: inherit; color: var(--muted); transition: border-color .18s, background .18s;
}
.dm-table:hover { border-color: var(--line2); }
.dm-table b { font-size: 16px; color: var(--text); }
.dm-table i { font-style: normal; font-size: 10.5px; color: var(--dim); }
.dm-table u { text-decoration: none; font-size: 11px; font-weight: 600; color: var(--accent); font-family: "JetBrains Mono", monospace; }
.dm-table.busy { border-color: rgba(55, 214, 122, .4); background: rgba(55, 214, 122, .08); }
.dm-table.sel { outline: 2px solid var(--accent2); outline-offset: 1px; }
.dm-table.bell::after {
  content: "!"; position: absolute; top: 5px; right: 6px; width: 15px; height: 15px;
  border-radius: 50%; background: var(--warn); color: #201800; font-size: 10px; font-weight: 800;
  display: grid; place-items: center;
}

/* menu */
.dm-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.dm-cat {
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  background: var(--panel2); color: var(--muted); border: 1px solid var(--line);
  border-radius: 9px; padding: 7px 13px;
}
.dm-cat.on { background: rgba(55, 214, 122, .12); border-color: rgba(55, 214, 122, .45); color: var(--accent); }
.dm-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; align-content: start; }
.dm-item {
  position: relative; text-align: left; cursor: pointer; font: inherit;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; min-height: 84px; display: flex; flex-direction: column; justify-content: space-between;
  transition: border-color .18s, transform .12s;
}
.dm-item:hover:not(:disabled) { border-color: var(--accent2); transform: translateY(-2px); }
.dm-item:disabled { opacity: .4; cursor: not-allowed; }
.dm-item-n { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.3; }
.dm-item-p { font-family: "JetBrains Mono", monospace; font-size: 14px; color: var(--accent); margin-top: 8px; }
.dm-item-t {
  position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 700;
  color: var(--dim); border: 1px solid var(--line2); border-radius: 5px; padding: 1px 5px;
}
.dm-pick { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--dim); }
.dm-pick-ico { font-size: 40px; color: var(--line2); }

/* check panel */
.dm-check-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.dm-check-h b { font-size: 15px; }
.dm-st {
  font-style: normal; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 8px; border-radius: 6px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line2);
  margin-left: 8px;
}
.dm-st.open { color: var(--accent2); border-color: rgba(40, 182, 201, .4); }
.dm-st.precheck { color: var(--warn); border-color: rgba(229, 169, 60, .4); }
.dm-st.closed { color: var(--blue); border-color: rgba(91, 124, 250, .4); }
.dm-st.fiscalized { color: var(--accent); border-color: rgba(55, 214, 122, .4); }
.dm-st.refunded { color: var(--danger); border-color: rgba(226, 96, 90, .4); }
.dm-src, .dm-bell {
  font-size: 10.5px; padding: 3px 8px; border-radius: 6px;
  background: rgba(91, 124, 250, .12); color: var(--blue); border: 1px solid rgba(91, 124, 250, .3);
}
.dm-bell { background: rgba(229, 169, 60, .12); color: var(--warn); border-color: rgba(229, 169, 60, .35); }
.dm-lock {
  font-size: 11.5px; color: var(--warn); background: rgba(229, 169, 60, .09);
  border: 1px solid rgba(229, 169, 60, .28); border-radius: 9px; padding: 7px 11px; margin-bottom: 10px;
}
.dm-lock code { font-family: "JetBrains Mono", monospace; }

.dm-lines { flex: 0 0 auto; display: grid; gap: 6px; align-content: start; }
.dm-line {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  padding: 9px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line);
}
.dm-line.fired { border-left: 2px solid var(--warn); }
.dm-line.ready { border-left: 2px solid var(--accent); }
.dm-line-n { font-size: 13px; font-weight: 500; display: block; }
.dm-line-s { font-size: 10.5px; color: var(--dim); display: block; margin-top: 2px; }
.dm-line-a { font-family: "JetBrains Mono", monospace; font-size: 13px; font-weight: 500; }
.dm-qty { display: flex; align-items: center; gap: 2px; }
.dm-qty button {
  width: 24px; height: 24px; border-radius: 7px; cursor: pointer; font: inherit; font-size: 14px;
  background: var(--panel2); border: 1px solid var(--line2); color: var(--text); line-height: 1;
}
.dm-qty button:disabled { opacity: .3; cursor: not-allowed; }
.dm-qty span { min-width: 22px; text-align: center; font-size: 13px; font-weight: 600; }
.dm-qty.sm button { width: 22px; height: 22px; font-size: 13px; }

.dm-tot { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line2); }
.dm-tr { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; color: var(--muted); }
.dm-tr b { font-family: "JetBrains Mono", monospace; color: var(--text); font-weight: 500; }
.dm-tr b i { font-style: normal; color: var(--dim); font-size: 11px; }
.dm-tr.warn b { color: var(--warn); }
.dm-tr.big { font-size: 14px; font-weight: 700; color: var(--text); margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.dm-tr.big b { font-size: 19px; color: var(--accent); }
.dm-vat { display: flex; flex-wrap: wrap; gap: 8px; font-size: 10.5px; color: var(--dim); margin-top: 6px; font-family: "JetBrains Mono", monospace; }

.dm-fiscal {
  margin-top: 12px; padding: 12px; border-radius: 11px;
  background: rgba(55, 214, 122, .07); border: 1px solid rgba(55, 214, 122, .3);
}
.dm-fiscal-h { font-size: 12px; font-weight: 700; color: var(--accent); }
.dm-fiscal-r { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.dm-fiscal-r code { font-family: "JetBrains Mono", monospace; color: var(--text); }
.dm-qr { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; width: 84px; margin: 10px auto 2px; }
.dm-qr i { aspect-ratio: 1; background: transparent; border-radius: 1px; }
.dm-qr i.f { background: var(--accent); }

.dm-acts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.dm-acts .dm-btn { flex: 1 1 44%; }

/* pay modal */
.dm-modal { position: absolute; inset: 0; background: rgba(2, 5, 8, .7); display: grid; place-items: center; z-index: 5; }
.dm-modal-in {
  background: var(--panel); border: 1px solid var(--line2); border-radius: 16px;
  padding: 26px; width: min(340px, 90%); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .9);
}
.dm-modal-in h3 { font-size: 16px; margin-bottom: 14px; }
.dm-pay-amt { font-family: "JetBrains Mono", monospace; font-size: 32px; font-weight: 600; color: var(--accent); text-align: center; margin-bottom: 18px; }
.dm-pay-m { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dm-tip { display: block; font-size: 12px; color: var(--muted); margin-top: 16px; }
.dm-tipset { display: flex; gap: 6px; margin-top: 7px; }
.dm-tipset .dm-btn { flex: 1; }
.dm-modal-a { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }

/* ─────────────  KDS  ───────────── */
.dm-kds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 16px; height: 100%; align-content: start; }
.dm-kdscol h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
  margin-bottom: 10px; display: flex; justify-content: space-between; font-weight: 700;
}
.dm-kdscol h4 span { color: var(--accent); }
.dm-tkt { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 12px; padding: 13px; margin-bottom: 10px; }
.dm-tkt.ready { border-left-color: var(--accent); opacity: .7; }
.dm-tkt.del { border-left-color: var(--accent2); }
.dm-tkt.del.ready { border-left-color: var(--accent); }
.dm-tkt-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dm-tkt-h b { font-size: 14px; }
.dm-tkt-h i { font-style: normal; font-size: 10.5px; color: var(--dim); }
.dm-tkt ul { list-style: none; display: grid; gap: 5px; margin-bottom: 11px; }
.dm-tkt li { font-size: 13.5px; color: var(--text); }
.dm-tkt li b { color: var(--accent2); font-family: "JetBrains Mono", monospace; margin-right: 4px; }
.dm-tkt-ok { font-size: 12px; font-weight: 700; color: var(--accent); }

/* ─────────────  DOSTAVA  ───────────── */
.dm-plat {
  font-size: 12px; font-weight: 800; letter-spacing: -.01em;
  padding: 3px 10px; border-radius: 6px; font-style: normal;
}
.dm-plat.sm { font-size: 10.5px; padding: 2px 8px; }
.dm-plat.wolt { background: #00c2e8; color: #04222a; }
.dm-plat.glovo { background: #ffc244; color: #2a1d00; }

.dm-del { padding: 16px; display: grid; gap: 16px; align-content: start; }
.dm-del-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dm-del-hint { color: var(--dim); font-size: 12.5px; flex: 1 1 260px; }
.dm-del-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.dm-delcol {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  display: grid; gap: 10px; align-content: start;
}
.dm-delcol h4 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
  font-weight: 700; display: flex; justify-content: space-between;
}
.dm-delcol h4 span { color: var(--accent); }
.dm-dcard {
  background: var(--panel2); border: 1px solid var(--line2); border-radius: 12px;
  padding: 13px; display: grid; gap: 10px;
}
.dm-dcard.wolt { border-left: 3px solid #00c2e8; }
.dm-dcard.glovo { border-left: 3px solid #ffc244; }
.dm-dcard-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dm-dno { font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: var(--text); }
.dm-deta { margin-left: auto; font-size: 11.5px; color: var(--dim); }
.dm-dlines { display: grid; gap: 4px; font-size: 13.5px; }
.dm-dlines b { color: var(--accent2); font-family: "JetBrains Mono", monospace; margin-right: 4px; }
.dm-dfoot { display: flex; justify-content: space-between; align-items: baseline; }
.dm-dfoot b { font-family: "JetBrains Mono", monospace; font-size: 17px; color: var(--accent); }
.dm-dfoot i { font-style: normal; font-size: 11.5px; color: var(--dim); }
.dm-dstate {
  font-size: 11.5px; font-weight: 600; color: var(--warn);
  background: rgba(229, 169, 60, .1); border: 1px solid rgba(229, 169, 60, .3);
  border-radius: 8px; padding: 6px 10px; text-align: center;
}
.dm-dstate.ready { color: var(--accent); background: rgba(55, 214, 122, .1); border-color: rgba(55, 214, 122, .35); }

/* ─────────────  BACK-OFFICE  ───────────── */
.dm-office { padding: 18px; display: grid; gap: 16px; align-content: start; }
.dm-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.dm-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.dm-tile i { font-style: normal; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); font-weight: 600; }
.dm-tile b { display: block; font-family: "JetBrains Mono", monospace; font-size: 20px; font-weight: 500; margin-top: 5px; }
.dm-tile.accent b { color: var(--accent); }
.dm-tile.warn b { color: var(--warn); }
.dm-tile.blue b { color: var(--accent2); }
.dm-office-grid { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 14px; align-items: start; }
.dm-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.dm-card h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 12px; font-weight: 700; }
.dm-card h4.mt { margin-top: 20px; }
.dm-office-acts { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.dm-feed { display: grid; gap: 7px; max-height: 340px; overflow-y: auto; }
.dm-frow {
  display: flex; justify-content: space-between; align-items: center; gap: 6px 10px; flex-wrap: wrap;
  padding: 9px 11px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; font-size: 13px;
}
.dm-frow code { font-family: "JetBrains Mono", monospace; font-size: 11px; color: var(--dim); margin-left: 6px; }
.dm-frow b { font-family: "JetBrains Mono", monospace; font-weight: 500; }
.dm-frow-r { display: flex; align-items: center; gap: 9px; }
.dm-doc {
  font-size: 11px; font-weight: 700; padding: 2px 7px;
  border-radius: 5px; background: rgba(55, 214, 122, .12); color: var(--accent); border: 1px solid rgba(55, 214, 122, .3);
}
.dm-doc.PR { background: rgba(226, 96, 90, .12); color: var(--danger); border-color: rgba(226, 96, 90, .3); }

/* stubovi po kanalima */
.dm-bar { margin-bottom: 12px; }
.dm-bar-h { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.dm-bar-h b { font-family: "JetBrains Mono", monospace; font-weight: 500; }
.dm-bar-t { height: 7px; border-radius: 4px; background: var(--panel2); overflow: hidden; }
.dm-bar-t span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.dm-bar-t span.wolt { background: #00c2e8; }
.dm-bar-t span.glovo { background: #ffc244; }

/* ─────────────  toasts  ───────────── */
.dm-toasts { position: absolute; bottom: 18px; right: 18px; display: grid; gap: 8px; z-index: 10; justify-items: end; pointer-events: none; }
.dm-toast {
  background: var(--panel); border: 1px solid var(--accent); color: var(--text);
  padding: 10px 18px; border-radius: 11px; font-size: 13.5px; font-weight: 500;
  box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .9); animation: toastin .25s ease;
}
.dm-toast.err { border-color: var(--danger); color: #ffd9d7; }
.dm-toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }

/* ─────────────  responsive  ───────────── */
@media (max-width: 1200px) {
  .dm-office-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .dm { padding: 0; }
  .dm-win { height: 100%; border-radius: 0; border: 0; }
  .dm-kasa { grid-template-columns: 1fr; grid-template-rows: auto auto auto; height: auto; }
  .dm-col.plan, .dm-col.check { border: 0; border-bottom: 1px solid var(--line); }
  .dm-kds, .dm-del-cols { grid-template-columns: 1fr; }
  .dm-online { display: none; }
  .dm-tiles { grid-template-columns: 1fr 1fr; }
  .dm-office-grid { grid-template-columns: 1fr; }
  .dm-tkt { border-left-width: 3px; }
  .dm-roles { order: 3; width: 100%; margin: 0; }
  .dm-top { position: relative; padding-right: 46px; }
  .dm-top-r { order: 2; width: 100%; flex-wrap: wrap; }
  .dm-x { position: absolute; top: 9px; right: 10px; }
}
