:root { --accent: #b01313; --ink: #17181c; --line: #e5e5e5; --muted: #6b7280; --bg: #f6f6f4; }
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.45; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
a { color: inherit; }

.topbar { background: #111; color: #fff; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
.brand { font-weight: 900; font-size: 1.15rem; text-decoration: none; letter-spacing: -.5px; }
.brand span { color: var(--accent); }
.brand em { font-style: normal; font-weight: 500; opacity: .6; font-size: .85rem; }
.topbar nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar nav a { color: #fff; text-decoration: none; opacity: .85; font-size: .93rem; }
.topbar nav a:hover { opacity: 1; }
.topbar .who { opacity: .6; font-size: .88rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.dot.on { background: #22c55e; } .dot.off { background: #ef4444; }

main { padding: 18px 16px 40px; }
h1 { font-size: 1.4rem; margin: 4px 0 14px; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 14px; border-top: 3px solid var(--accent); }
.card.narrow { max-width: 460px; margin: 40px auto; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 10px; font-size: .93rem; }
.flash-ok { background: #ecfdf3; color: #067647; }
.flash-warn { background: #fffbeb; color: #b45309; }
.flash-err { background: #fef3f2; color: #b42318; }

label { display: block; margin-bottom: 10px; font-weight: 600; font-size: .9rem; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 9px 11px; border: 1px solid #cfcfcf; border-radius: 8px; font: inherit; background: #fff; }
.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 10px 18px; font: inherit; font-weight: 800; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #cfcfcf; }
.btn.big { width: 100%; padding: 16px; font-size: 1.2rem; margin-top: 10px; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; padding: 7px 6px; border-bottom: 2px solid var(--ink); }
td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.r { text-align: right; white-space: nowrap; }
.neg { color: #b42318; font-weight: 700; }
.muted { color: var(--muted); } .small { font-size: .84rem; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.b-ok { background: #ecfdf3; color: #067647; } .b-err { background: #fef3f2; color: #b42318; }
code { background: #f3f4f6; padding: 2px 6px; border-radius: 6px; font-size: .82rem; word-break: break-all; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.inline-form input, .inline-form select { width: auto; margin: 0; }

.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; border-top: 3px solid var(--accent); }
.stat .stat-label { display: block; color: var(--muted); font-size: .8rem; }
.stat strong { font-size: 1.35rem; }
.stat span:last-child { display: block; color: var(--muted); font-size: .82rem; }

/* ------------------------------------------------------------- POS --- */
.pos { display: grid; grid-template-columns: 1fr 360px; gap: 14px; align-items: start; }
@media (max-width: 980px) { .pos { grid-template-columns: 1fr; } }
.searchbar { display: flex; gap: 8px; }
.searchbar input { flex: 1; margin: 0; font-size: 1.1rem; padding: 13px 15px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 12px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; transition: .12s; }
.tile:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); border-color: var(--accent); }
.tile img { width: 100%; aspect-ratio: 4/3; object-fit: contain; background: #fafafa; display: block; }
.tile-b { padding: 9px 11px; display: flex; flex-direction: column; gap: 2px; }
.tile-b strong { font-size: .88rem; line-height: 1.25; }
.tile-b .mut { color: var(--muted); font-size: .78rem; }
.tile-b .price { color: var(--accent); font-weight: 800; }

.pos-right { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; border-top: 3px solid var(--accent); position: sticky; top: 12px; }
.cart { max-height: 320px; overflow-y: auto; margin-bottom: 10px; }
.citem { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.citem .del { color: #b42318; font-size: .78rem; }
.cartrow { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.cartrow input { width: 110px; margin: 0; text-align: right; }
.cartrow.total { border-top: 2px solid var(--ink); font-size: 1.15rem; margin-top: 6px; padding-top: 10px; }
.typeinfo { border-radius: 8px; padding: 8px 11px; font-size: .85rem; margin: 8px 0; min-height: 20px; }
.typeinfo.ok { background: #ecfdf3; color: #067647; font-weight: 600; }
.typeinfo.bad { background: #fef3f2; color: #b42318; font-weight: 700; }
.payrow { display: flex; gap: 8px; }
.payopt { flex: 1; display: flex; gap: 8px; align-items: center; border: 2px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer; font-weight: 700; }
.payopt input { width: auto; margin: 0; accent-color: var(--accent); }
.payopt:has(input:checked) { border-color: var(--accent); background: #fff5f5; }

.dlg { border: 0; border-radius: 14px; padding: 20px; max-width: 420px; width: 92%; }
.dlg::backdrop { background: rgba(0,0,0,.45); }
.dlg-actions { display: flex; gap: 10px; margin-top: 12px; }

/* Výběr velikosti (seskupené produkty) */
#sizeDlg { max-width: 520px; }
.sizegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.sizebtn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px;
  border: 2px solid var(--line); border-radius: 10px; background: #fff; font: inherit; cursor: pointer; }
.sizebtn strong { font-size: 1.05rem; }
.sizebtn span { font-size: .8rem; color: var(--accent); font-weight: 700; }
.sizebtn:hover { border-color: var(--accent); background: #fff5f5; }
.sizebtn:disabled { opacity: .4; cursor: not-allowed; }
.sizebtn .mut { color: var(--muted); font-weight: 400; }

/* interní info: komitent u nabídky (na doklad se nepropisuje) */
.tile-b .kom, .sizebtn .kom { font-size: .72rem; color: #6b7280; font-weight: 600; }

/* --------------------------------------------- Reklamace (průvodce) -- */
.wiz { max-width: 720px; margin: 0 auto; }
.wiz-steps { display: flex; gap: 6px; margin: 2px 0 14px; }
.wiz-steps span { flex: 1; height: 7px; border-radius: 99px; background: #e5e5e5; transition: .2s; }
.wiz-steps span.on { background: var(--accent); }
.step { display: none; }
.step.on { display: block; animation: stepin .18s ease; }
@keyframes stepin { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
.step h2 { margin-bottom: 14px; }
.wiz-sub { font-size: .95rem; margin: 14px 0 8px; }
.wiz .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 620px) { .wiz .row2 { grid-template-columns: 1fr; } }
.wiz-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.wiz-nav .btn { padding: 13px 26px; font-size: 1.02rem; }
.sumtable { width: 100%; }
.sumtable td:first-child { color: var(--muted); width: 40%; font-weight: 600; }
.badge.b-warn { background: #fffbeb; color: #b45309; }

/* Poptávky a zálohy */
.badge.b-info { background: #eef4ff; color: #1d4ed8; }
.badge.b-err { background: #fdeaea; color: #8a1111; }
