/* Poskio app — same graphic charter as poskio.com */
:root {
  --accent: #1f4fe0; --accent-ink: #1638b0; --accent-soft: #edf1ff;
  --bg: #fafaf8; --surface: #ffffff; --line: #e6e8ee; --line-2: #d6dae3;
  --ink: #0d1424; --ink-2: #2b3445; --muted: #667085;
  --dark: #0b1220; --dark-2: #141d30;
  --ok: #12805c; --ok-soft: #e7f6ef; --warn: #b54708; --warn-soft: #fff4e5; --bad: #c0262d; --bad-soft: #fdecec;
  --radius: 12px; --shadow: 0 1px 2px rgba(13,20,36,.06), 0 4px 16px rgba(13,20,36,.06);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
h1 { font-size: 24px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.hide { display: none !important; }

/* boot */
.boot { height: 100vh; display: grid; place-items: center; }
.logo-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent) center/20px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='12' rx='2'/%3E%3Cpath d='M8 20h8M12 16v4'/%3E%3C/svg%3E"); flex: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; color: inherit; }

/* buttons & inputs */
.btn { appearance: none; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 14px var(--font); padding: 9px 15px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.dark { background: var(--dark); border-color: var(--dark); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn.lg { padding: 13px 20px; font-size: 16px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
label.f { display: block; font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
label.f > span { display: block; margin-bottom: 5px; }
input, select, textarea { font: 500 14.5px var(--font); color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 11px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side { background: var(--dark); color: #dfe6f5; padding: 48px clamp(24px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; }
.auth-side .brand { color: #fff; }
.auth-side h2 { color: #fff; font-size: clamp(26px, 3vw, 36px); font-weight: 800; line-height: 1.15; margin: 34px 0 14px; }
.auth-side ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 11px; }
.auth-side li { padding-left: 28px; position: relative; }
.auth-side li::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent) center/11px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.auth-main { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 410px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin: 0 0 24px; }
.err { background: var(--bad-soft); color: var(--bad); border-radius: 9px; padding: 9px 12px; margin-bottom: 12px; font-weight: 600; font-size: 13.5px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* shell */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--dark); color: #b8c2d6; padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.side .brand { color: #fff; padding: 4px 8px 16px; }
.nav-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6b7894; margin: 14px 10px 6px; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 10px; color: #c8d1e3; padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.nav a:hover { background: var(--dark-2); color: #fff; }
.nav a.on { background: var(--accent); color: #fff; }
.nav a .lock { margin-left: auto; font-size: 10px; background: #26324c; color: #9fb0d4; border-radius: 5px; padding: 1px 6px; font-weight: 700; }
.ico { width: 18px; height: 18px; flex: none; background: currentColor; -webkit-mask: var(--i) center/contain no-repeat; mask: var(--i) center/contain no-repeat; }
.side-foot { margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid #1e2940; font-size: 13px; }
.plan-pill { display: inline-block; background: #1e2a45; color: #fff; border-radius: 6px; padding: 2px 8px; font-weight: 700; font-size: 12px; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px clamp(16px, 3vw, 28px); border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.top .burger { display: none; }
.content { padding: clamp(16px, 3vw, 28px); max-width: 1400px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { flex: 1; }
.trial-bar { background: var(--accent-soft); color: var(--accent-ink); padding: 8px clamp(16px,3vw,28px); font-weight: 600; font-size: 13.5px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.trial-bar.over { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; z-index: 30; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .shell.open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .top .burger { display: inline-flex; }
}

/* cards & tables */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-h h2 { flex: 1; font-size: 15px; }
.card-b { padding: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px; }
.kpi .l { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.kpi .v { font-size: 25px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 18px; }
.cols.even { grid-template-columns: 1fr 1fr; }
@media (max-width: 1000px) { .cols, .cols.even { grid-template-columns: 1fr; } }
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbfbfd; white-space: nowrap; }
.t td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: #f6f8ff; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 700; background: #eef0f4; color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.blue { background: var(--accent-soft); color: var(--accent-ink); }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.toolbar input, .toolbar select { width: auto; min-width: 140px; }
.toolbar input[type=search] { flex: 1; min-width: 180px; }

/* charts */
.chart { width: 100%; height: auto; display: block; }
.chart text { font: 600 11px var(--font); fill: var(--muted); }
.bar { fill: var(--accent); }
.bar:hover { fill: var(--accent-ink); }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; margin: 9px 0; font-size: 13.5px; }
.hbar .track { height: 9px; background: #eef1f7; border-radius: 5px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--accent); border-radius: 5px; }
.hbar .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* POS */
.pos { display: grid; grid-template-columns: 1fr 390px; height: calc(100vh - 60px); }
.pos-left { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); }
.pos-search { padding: 12px 16px; display: flex; gap: 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.cats { display: flex; gap: 8px; padding: 10px 16px; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--surface); scrollbar-width: thin; }
.chip { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 6px 13px; font: 700 13px var(--font); cursor: pointer; white-space: nowrap; color: var(--ink-2); }
.chip.on { background: var(--dark); color: #fff; border-color: var(--dark); }
.pgrid { flex: 1; overflow-y: auto; padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; align-content: start; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 12px; text-align: left; cursor: pointer; font-family: var(--font); display: flex; flex-direction: column; gap: 6px; min-height: 104px; border-top: 4px solid var(--c, var(--accent)); transition: transform .08s, box-shadow .12s; }
.pcard:hover { box-shadow: var(--shadow); }
.pcard:active { transform: scale(.97); }
.pcard .n { font-weight: 700; font-size: 14px; line-height: 1.25; color: var(--ink); flex: 1; }
.pcard .p { font-weight: 800; color: var(--accent-ink); font-size: 15px; }
.pcard .s { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.pcard .s.low { color: var(--bad); }
.cart { display: flex; flex-direction: column; background: var(--surface); min-height: 0; }
.cart-h { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.cart-items { flex: 1; overflow-y: auto; }
.ci { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.ci .n { font-weight: 700; }
.ci .qty { display: flex; align-items: center; gap: 6px; }
.ci .qty button { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line-2); background: #fff; font: 700 15px var(--font); cursor: pointer; }
.ci .qty input { width: 56px; text-align: center; padding: 4px; }
.ci .tot { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.cart-f { border-top: 1px solid var(--line); padding: 14px 16px; display: grid; gap: 8px; }
.line { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.line.big { font-size: 22px; font-weight: 800; }
.pay-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 1000px) { .pos { grid-template-columns: 1fr; height: auto; } .pos-left { border-right: 0; } .pgrid { max-height: 55vh; } }

/* tables screen & kitchen */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tcell { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 16px; cursor: pointer; min-height: 110px; display: flex; flex-direction: column; gap: 4px; font-family: var(--font); text-align: left; }
.tcell.busy { border-color: var(--accent); background: var(--accent-soft); }
.tcell .n { font-weight: 800; font-size: 17px; }
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.ticket { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.ticket .th { padding: 10px 14px; color: #fff; background: var(--dark); display: flex; justify-content: space-between; font-weight: 700; }
.ticket.preparing .th { background: var(--warn); }
.ticket.ready .th { background: var(--ok); }
.ticket ul { margin: 0; padding: 10px 14px; list-style: none; flex: 1; font-size: 15px; }
.ticket li { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.ticket .tf { padding: 10px 14px; display: flex; gap: 8px; }

/* modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(11,18,32,.5); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 860px; }
.modal-h { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-h h2 { flex: 1; }
.modal-b { padding: 20px; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background: #fff; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; }
.toast { background: var(--dark); color: #fff; padding: 11px 18px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow); animation: tin .2s; }
.toast.bad { background: var(--bad); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
.method { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.method button { padding: 12px 6px; border: 2px solid var(--line); border-radius: 10px; background: #fff; font: 700 13.5px var(--font); cursor: pointer; }
.method button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: -4px; margin-bottom: 12px; }

/* plans */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.plan { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.plan.cur { border: 2px solid var(--accent); }
.plan .price { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.plan ul { padding-left: 18px; margin: 0; color: var(--ink-2); font-size: 13.5px; display: grid; gap: 4px; flex: 1; }
.locked { padding: 48px 20px; text-align: center; max-width: 520px; margin: 40px auto; }
.locked .big-lock { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); margin: 0 auto 16px; display: grid; place-items: center; color: var(--accent); }

/* receipt & print */
.receipt { width: 300px; margin: 0 auto; font: 500 12.5px/1.4 ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; color: #000; }
.receipt .c { text-align: center; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 8px 0; }
.receipt .l { display: flex; justify-content: space-between; gap: 8px; }
.doc { font-family: var(--font); color: #000; max-width: 780px; margin: 0 auto; font-size: 13px; }
.doc table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.doc th, .doc td { border-bottom: 1px solid #ccc; padding: 7px 6px; text-align: left; }
.labels { display: flex; flex-wrap: wrap; gap: 6px; }
.label { width: 50mm; height: 30mm; border: 1px dashed #bbb; padding: 2mm; text-align: center; font: 600 10px var(--font); overflow: hidden; }
.label svg { width: 100%; height: 14mm; }
#print-root { display: none; }
@media print {
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  @page { margin: 6mm; }
}
