[hidden] { display: none !important; }
:root {
  --bg: #f1f5f9; --card: #fff; --ink: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --brand: #0f172a; --ok: #16a34a; --warn: #d97706; --err: #dc2626; --blue: #2563eb;
  --r: 12px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); display: flex; flex-direction: column; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; border-radius: 10px; padding: .7em 1em; background: #e2e8f0; color: var(--ink); touch-action: manipulation; }
button:active { transform: scale(.97); }
button.primary { background: var(--blue); color: #fff; }
button.danger { background: #fee2e2; color: var(--err); }
button.ghost { background: transparent; border: 1px solid var(--line); }
button:disabled { opacity: .5; }
input, select, textarea { width: 100%; padding: .65em .75em; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; }
label { display: block; font-size: .85rem; color: var(--muted); margin: .7em 0 .25em; }
label.check { display: flex; gap: .5em; align-items: center; color: var(--ink); font-size: 1rem; }
label.check input { width: auto; }
h2 { margin: .2em 0 .6em; font-size: 1.25rem; }
h3 { margin: 1.2em 0 .5em; font-size: 1.05rem; }
.muted { color: var(--muted); font-size: .9rem; }
.row { display: flex; gap: .5em; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75em; }
.card { background: var(--card); border-radius: var(--r); padding: 1em; margin: .75em; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.page { flex: 1; overflow: auto; padding-bottom: 2em; }
.err { color: var(--err); }
.okc { color: var(--ok); }

/* horní lišta */
#topbar { display: flex; align-items: center; gap: .5em; background: var(--brand); color: #fff; padding: calc(.4em + env(safe-area-inset-top)) .6em .4em; }
#topbar .title { flex: 1; min-width: 0; line-height: 1.15; }
#topbar .title b, #topbar .title small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#topbar .title small { opacity: .7; }
button.icon { background: transparent; color: #fff; font-size: 1.4rem; padding: .2em .5em; }
.pill { border-radius: 99px; padding: .35em .8em; font-size: .85rem; background: #334155; color: #fff; white-space: nowrap; }
.pill.on { background: #166534; } .pill.off { background: #9a3412; } .pill.wait { background: #a16207; }
#menu { position: fixed; z-index: 20; top: 3.2em; left: .5em; background: #fff; border-radius: var(--r); box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: .4em; min-width: 240px; }
#menu a { display: block; padding: .8em 1em; color: var(--ink); text-decoration: none; border-radius: 8px; }
#menu a:hover, #menu a.active { background: var(--bg); }
#app { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* pokladna */
.pos { flex: 1; display: grid; grid-template-rows: auto minmax(60px, 1fr) auto auto auto; min-height: 0; max-width: 720px; width: 100%; margin: 0 auto; }
.display { background: #0b1220; color: #fff; padding: .4em .8em; text-align: right; }
.display .amt { font-size: 2.4rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.display .sub { color: #94a3b8; min-height: 1.2em; font-size: .9rem; }
.cart { overflow: auto; background: #fff; border-bottom: 1px solid var(--line); }
.cart .empty { color: var(--muted); text-align: center; padding: 1em; }
.cart .it { display: flex; align-items: center; gap: .5em; padding: .45em .8em; border-bottom: 1px solid #f1f5f9; }
.cart .it .l { flex: 1; min-width: 0; }
.cart .it .l small { color: var(--muted); display: block; }
.cart .it .a { font-weight: 600; font-variant-numeric: tabular-nums; }
.cart .it button { background: transparent; color: var(--err); padding: .2em .5em; font-size: 1.1rem; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .4em; padding: .4em; }
.cats button { color: #fff; font-weight: 600; min-height: 3.1em; line-height: 1.15; padding: .4em; }
.cats button small { display: block; font-weight: 400; opacity: .85; font-size: .78rem; }
.keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35em; padding: 0 .4em .4em; }
.keys button { font-size: 1.45rem; padding: .45em 0; background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.08); font-variant-numeric: tabular-nums; }
.keys button.fn { background: #e2e8f0; font-size: 1.15rem; }
.keys button.c { background: #fee2e2; color: var(--err); }
.pay { display: grid; grid-template-columns: 1fr 1fr; gap: .4em; padding: 0 .4em calc(.4em + env(safe-area-inset-bottom)); }
.pay button { font-size: 1.15rem; font-weight: 700; padding: .8em .3em; color: #fff; }
.pay .cash { background: var(--ok); } .pay .card { background: var(--blue); }
.totalbar { display: flex; justify-content: space-between; align-items: baseline; padding: .35em .8em; font-weight: 700; background: #fff; }
.totalbar .v { font-size: 1.4rem; }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* seznamy */
.list .li { display: flex; gap: .6em; align-items: center; padding: .7em .2em; border-bottom: 1px solid var(--line); cursor: pointer; }
.list .li .grow { flex: 1; min-width: 0; }
.list .li .grow small { display: block; color: var(--muted); }
.badge { font-size: .75rem; padding: .2em .55em; border-radius: 99px; white-space: nowrap; font-weight: 600; }
.b-ok { background: #dcfce7; color: #166534; } .b-pending { background: #fef3c7; color: #92400e; } .b-error { background: #fee2e2; color: #991b1b; } .b-off { background: #e2e8f0; color: #475569; } .b-local { background: #e0e7ff; color: #3730a3; }
table.t { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.t td, table.t th { padding: .4em .3em; border-bottom: 1px solid var(--line); text-align: left; }
table.t td.n, table.t th.n { text-align: right; }
.big { font-size: 1.6rem; font-weight: 700; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6em; }
.kpi { background: var(--bg); border-radius: 10px; padding: .7em; }
.kpi b { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: .3em; overflow-x: auto; padding: .2em 0 .6em; }
.tabs button { white-space: nowrap; background: #fff; border: 1px solid var(--line); }
.tabs button.sel { background: var(--ink); color: #fff; }
.swatch { width: 1.4em; height: 1.4em; border-radius: 6px; display: inline-block; vertical-align: middle; }

/* modal + toast */
#modal { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
#modal .sheet { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 1.1em 1.1em calc(1.1em + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { #modal { align-items: center; } #modal .sheet { border-radius: 18px; } }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 1.5em; background: var(--ink); color: #fff; padding: .75em 1.2em; border-radius: 12px; z-index: 40; max-width: 90vw; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
#toast.bad { background: var(--err); }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4em; margin: .5em 0; }
.change { font-size: 1.6rem; font-weight: 700; text-align: center; margin: .4em 0; }
.preview { text-align: center; background: var(--bg); padding: .6em; border-radius: 10px; }
.preview canvas, .preview img { max-width: 100%; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.login { max-width: 380px; margin: 8vh auto; width: calc(100% - 1.5em); }
.login h1 { font-size: 1.6rem; margin: 0 0 .2em; }

#printArea { display: none; }
@media print {
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block !important; }
  #printArea img { width: 80mm; }
}
