:root {
  --bg: #f5f5f7;
  --win: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.12);
  --fill: #f5f5f7;
  --fill-2: #e8e8ed;
  --sel: #e8f1fb;
  --blue: #0071e3;
  --blue-press: #0077ed;
  --green: #1d1d1f;
  --green-2: #0071e3;
  --green-3: #2997ff;
  --cap: #1d1d1f;
  --ok: #248a3d;
  --ok-bg: #e4f8e9;
  --warn: #c93400;
  --warn-bg: #fff3e0;
  --danger: #d70015;
  --white: #fff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
  --radius: 16px;
  --radius-sm: 10px;
  --top-h: 52px;
  --side-w: 248px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  padding-top: var(--top-h);
  padding-left: var(--side-w);
  letter-spacing: -0.01em;
  transition: padding-left 0.22s ease;
}
body.nav-collapsed { padding-left: 0; }
html.nav-collapsed-boot body { padding-left: 0; }
html.nav-collapsed-boot .erp-side { transform: translateX(-105%); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.erp-top {
  position: fixed; inset: 0 0 auto 0; height: var(--top-h); z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 0 18px;
  background: rgba(251, 251, 253, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
}
.erp-top a {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex; align-items: center;
  height: 32px; padding: 0 10px;
  border-radius: 8px;
  font-weight: 500;
}
.erp-top a:hover { background: var(--fill-2); text-decoration: none; }
.brand {
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 15px; font-weight: 650; letter-spacing: -0.03em;
}
.brand small {
  margin-left: 8px; font-size: 12px; font-weight: 500; color: var(--muted);
  letter-spacing: 0;
}
.firma { color: var(--muted); font-weight: 500; }
.who {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 12px;
  min-width: 0;
}
.who-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erp-top > a { flex: 0 0 auto; }
.who-meta { white-space: nowrap; }
.who-backup { color: var(--muted); }
.day-on, .day-off {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 650; letter-spacing: 0.01em;
}
.day-on { background: var(--ok-bg); color: var(--ok); }
.day-off { background: var(--warn-bg); color: var(--warn); }
.erp-top a.brand {
  gap: 8px;
  padding: 0 8px 0 2px;
  height: 36px;
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px;
  display: block; flex: 0 0 28px;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
.brand-name { font-weight: 650; }
.hamburger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; min-width: 36px; height: 36px;
  background: transparent; color: var(--ink); border: 0;
  border-radius: 8px; cursor: pointer; padding: 0;
}
.hamburger:hover { background: var(--fill-2); }
.hamburger svg { display: block; }

.erp-side {
  position: fixed; top: var(--top-h); left: 0; bottom: 0; width: var(--side-w);
  background: #fbfbfd;
  color: var(--ink);
  overflow: auto; padding: 18px 10px 32px;
  z-index: 15;
  border-right: 1px solid var(--line);
  transition: transform 0.22s ease;
}
body.nav-collapsed .erp-side { transform: translateX(-105%); }
.mod-title {
  margin: 18px 12px 6px; font-size: 11px; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 650;
}
.mod-title:first-child { margin-top: 4px; }
.erp-side a {
  display: block; color: var(--ink); text-decoration: none;
  margin: 1px 6px; padding: 8px 12px; font-size: 13.5px; font-weight: 500;
  border-radius: 8px;
}
.erp-side a:hover { background: var(--fill-2); text-decoration: none; }
.erp-side a.on { background: var(--fill-2); font-weight: 650; }

.erp-main { padding: 28px 32px 48px; min-height: calc(100vh - var(--top-h)); }
.crumb { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.crumb h1 { margin: 0; font-size: 32px; font-weight: 650; letter-spacing: -0.035em; }
.crumb-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.win {
  background: var(--win);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.win-cap {
  background: transparent;
  color: var(--ink);
  padding: 16px 18px 12px;
  font-size: 17px; font-weight: 650; letter-spacing: -0.02em;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.win-cap a, .win-cap-link {
  color: var(--blue); font-size: 13px; font-weight: 500; letter-spacing: 0;
}
.win-body { padding: 16px 18px 18px; }
.toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 12px 18px;
  background: transparent;
  border-bottom: 1px solid var(--line);
}

.btn, .ghost {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0;
  background: var(--fill-2);
  color: var(--ink);
  text-decoration: none;
  font: 500 13px/1 var(--font);
  padding: 9px 14px;
  cursor: pointer;
  border-radius: 980px;
  letter-spacing: -0.01em;
}
.btn:hover, .ghost:hover { background: #dedee3; text-decoration: none; }
.btn.primary { background: #1d1d1f; color: #fff; }
.btn.primary:hover { background: #333336; }
.btn.warn { background: #ff9f0a; color: #1d1d1f; }
.btn.warn:hover { background: #ffb340; }
.btn.danger { background: transparent; color: var(--danger); box-shadow: none; }
.btn.danger:hover { background: #ffecec; }
.btn.wide, .wide { width: 100%; }

table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; background: transparent; }
table.grid th {
  background: transparent; text-align: left;
  padding: 10px 16px; border: 0; border-bottom: 1px solid var(--line);
  font-weight: 590; color: var(--muted); font-size: 12px;
  letter-spacing: 0.01em;
}
table.grid td { padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tr:nth-child(even) td { background: transparent; }
table.grid tr:hover td { background: rgba(0, 0, 0, 0.018); }
table.grid a { color: var(--ink); text-decoration: none; font-weight: 590; }
table.grid a:hover { color: var(--blue); }
.right { text-align: right; font-variant-numeric: tabular-nums; }
.muted, .hint, .empty { color: var(--muted); }
.empty { padding: 28px 16px; text-align: center; }
.debt { color: var(--warn); font-weight: 650; }
.okn { color: var(--ok); font-weight: 650; }
.warn { color: var(--warn); font-weight: 650; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.kpi {
  background: var(--win);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 18px;
  box-shadow: var(--shadow);
}
.kpi b {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--muted); letter-spacing: 0;
  text-transform: none;
  margin-bottom: 6px;
}
.kpi span { font-size: 24px; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.modules { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mod {
  display: block; background: var(--fill);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 16px 16px 18px;
  text-decoration: none; color: inherit; min-height: 92px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.mod:hover { background: var(--fill-2); text-decoration: none; }
.mod strong { display: block; color: var(--ink); font-size: 15px; font-weight: 650; letter-spacing: -0.02em; margin-bottom: 4px; }
.mod span { font-size: 12.5px; color: var(--muted); line-height: 1.35; }

.filter, .stack { display: grid; gap: 12px; }
.filter.row { grid-template-columns: 1fr auto auto; align-items: end; }
label { display: grid; gap: 6px; font-size: 12px; font-weight: 590; color: var(--muted); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  padding: 10px 12px;
  font: 15px/1.3 var(--font);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18);
}
.grid-2, .grid-3 { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  background: var(--fill-2); border: 0; padding: 7px 14px;
  text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 500;
  border-radius: 980px;
}
.chip:hover { background: #dedee3; text-decoration: none; }
.chip.on { background: #1d1d1f; color: #fff; }
.flash {
  padding: 12px 14px; margin: 0 0 14px;
  border: 0; border-radius: 12px; background: var(--fill-2);
  font-size: 13.5px;
}
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: #ffecec; color: var(--danger); }

.scan-bar { position: relative; z-index: 5; }
.suggest {
  position: absolute; left: 0; right: 0; top: 0; z-index: 6;
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px;
  max-height: 280px; overflow: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}
.suggest button {
  width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line);
  background: #fff; padding: 12px 14px; font: inherit; cursor: pointer;
}
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover { background: var(--fill); }
.cart { list-style: none; margin: 8px 0; padding: 0; }
.cart li {
  display: grid; grid-template-columns: minmax(0, 1fr) 96px auto;
  gap: 10px; align-items: center;
  background: var(--fill);
  border: 0;
  border-radius: 14px;
  padding: 12px 14px; margin-bottom: 8px;
}
.cart-name { min-width: 0; }
.cart-name strong, .cart-name small { display: block; overflow-wrap: anywhere; }
.cart-name strong { font-size: 15px; letter-spacing: -0.02em; }
.cart-name small { color: var(--muted); margin-top: 2px; }
.cart-price { width: 96px; }
.qty { display: flex; gap: 6px; align-items: center; }
.qty button {
  width: 34px; height: 34px; flex: 0 0 34px;
  border: 0; border-radius: 50%;
  background: #fff; color: var(--ink);
  font: 600 16px/1 var(--font); cursor: pointer;
}
.qty button:hover { background: var(--fill-2); }
.qty button.pack-btn {
  width: auto; min-width: 34px; flex: 0 0 auto;
  padding: 0 10px; font-size: 12px; border-radius: 980px;
}
.qty input { width: 56px; text-align: center; padding: 6px; }
.paybox {
  position: sticky; bottom: 0;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  z-index: 7;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.06);
}
.total-line {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 15px; font-weight: 500; color: var(--muted);
}
.total-line strong { font-size: 28px; font-weight: 650; color: var(--ink); letter-spacing: -0.04em; }
.pay-actions { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.pay-actions .btn { min-height: 44px; font-size: 15px; }
.favs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.favs button { background: var(--fill); }
.pay-fields { display: grid; grid-template-columns: 140px 1fr; gap: 12px; margin-bottom: 10px; }
.kasa-toolbar { align-items: center; }
.kasa-toolbar #lookup { flex: 1; min-width: 0; max-width: none; border: 0; padding: 12px 4px; background: transparent; box-shadow: none; }
.kasa-toolbar #lookup:focus { box-shadow: none; }
.kasa-lookup {
  flex: 1; min-width: 220px; max-width: 720px; margin: 0;
  display: flex; align-items: center; gap: 10px;
  background: var(--fill);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 14px;
}
.kasa-lookup:focus-within {
  background: #fff;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18);
}
.kasa-lookup-mark {
  width: 18px; height: 18px; flex: 0 0 18px;
  border: 1.8px solid var(--muted);
  border-radius: 50%;
  position: relative;
  opacity: 0.7;
}
.kasa-lookup-mark::after {
  content: "";
  position: absolute; right: -5px; bottom: -2px;
  width: 7px; height: 1.8px;
  background: var(--muted);
  transform: rotate(45deg);
  border-radius: 1px;
}
.kasa-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kasa-empty { text-align: center; padding: 48px 12px; font-size: 15px; }

.card-pop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0, 0, 0, 0.4);
  display: grid; place-items: center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  backdrop-filter: blur(8px);
}
.card-pop[hidden] { display: none !important; }
.card-pop .win, .pos-sheet {
  width: min(440px, 100%); margin: 0;
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}
.price-warn {
  margin: 10px 0 0;
  padding: 14px 16px;
  background: var(--warn-bg);
  border: 0;
  border-radius: 14px;
}
.price-warn p { margin: 0 0 10px; font-size: 13.5px; }
.price-warn .row { gap: 8px; }
.cart li.price-off { background: var(--warn-bg); }
.cart .price-drift { display: block; color: var(--warn); font-size: 12px; margin-top: 4px; }
.cart .price-drift button { margin-left: 6px; }

.scanner {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 50;
}
.scanner.open { display: block; }
.scan-reader { display: none !important; }
.scanner video, .scan-reader, .scan-reader video, #reader, #reader video {
  position: absolute; top: 0; left: 0;
  width: 100% !important; height: 100% !important;
  min-height: 100%;
  object-fit: cover;
  background: #000;
  z-index: 1;
}
.scan-ui {
  position: absolute; inset: 0; z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}
.scan-ui button, .scan-ui input, .scan-ui form, .scan-top, .scan-bottom, .scan-hit { pointer-events: auto; }
.scan-top {
  display: grid; grid-template-columns: 88px 1fr 88px;
  align-items: center; gap: 8px;
}
.scan-title {
  margin: 0; text-align: center; color: #fff;
  font-size: 13px; font-weight: 590; letter-spacing: 0.04em;
}
.scan-chip {
  border: 0; background: rgba(255, 255, 255, 0.16);
  color: #fff; min-height: 40px; padding: 8px 14px;
  font: 500 13px/1 var(--font); cursor: pointer;
  border-radius: 999px; backdrop-filter: blur(16px);
}
.scan-stage {
  display: grid; place-items: center; align-content: center; gap: 14px;
  pointer-events: none;
}
.scan-frame {
  position: relative;
  width: min(86vw, 520px);
  height: 118px;
  border: 0;
  background: transparent;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.46);
  border-radius: 12px;
}
.scan-c {
  position: absolute; width: 22px; height: 22px;
  border: 0 solid #fff;
}
.scan-c.tl { top: -1px; left: -1px; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 10px; }
.scan-c.tr { top: -1px; right: -1px; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 10px; }
.scan-c.bl { bottom: -1px; left: -1px; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 10px; }
.scan-c.br { bottom: -1px; right: -1px; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 10px; }
.scan-caption {
  margin: 0; color: rgba(255,255,255,0.82);
  font-size: 13px; letter-spacing: 0.02em; text-align: center;
}
.scan-bottom { display: grid; gap: 8px; }
.scan-last { min-height: 0; margin: 0; color: transparent; font-size: 0; }
.scanner.got-hit .scan-caption { visibility: hidden; }
.scan-hit {
  pointer-events: auto;
  margin: 0 auto 12px;
  width: min(92vw, 400px);
  background: #fff;
  color: var(--ink);
  border-radius: 20px;
  padding: 22px 18px 16px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}
.scan-hit-kicker {
  margin: 0 0 4px; font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ok); font-weight: 650;
}
.scan-hit p#scanHitName { margin: 0 0 14px; font-size: 20px; font-weight: 650; color: var(--ink); letter-spacing: -0.03em; }
.scan-hit .btn { width: 100%; min-height: 44px; }
.scan-manual {
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
  background: rgba(255, 255, 255, 0.14); padding: 8px;
  border-radius: 16px; backdrop-filter: blur(16px);
}
.scan-manual input {
  border: 0; background: transparent; color: #fff; min-height: 42px;
  box-shadow: none;
}
.scan-manual input::placeholder { color: rgba(255,255,255,0.55); }
.scanner.open .scan-frame.hit .scan-c { border-color: #30d158; }
.pack-ask {
  background: var(--warn-bg);
  border: 0;
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 8px;
}
.pack-ask[hidden] { display: none !important; }

.login-body {
  padding: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, #e8eef6 0%, transparent 55%),
    #f5f5f7;
  display: grid; place-items: center; min-height: 100vh;
}
.login-card {
  width: min(400px, 92vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.login-brand {
  display: grid; justify-items: center; gap: 10px; margin-bottom: 4px;
}
.login-mark {
  width: 64px; height: 64px; border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.login-kicker {
  margin: 0;
  font-size: 12px; font-weight: 650; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); text-align: center;
}
.login-card h1 {
  margin: 0 0 6px; font-size: 32px; font-weight: 650;
  letter-spacing: -0.04em; text-align: center;
}
.login-shop { margin: 0 0 8px; text-align: center; color: var(--muted); }
.login-card form,
.login-inner { padding: 36px 28px 28px; display: grid; gap: 14px; }
.frozen-copy { margin: 0; text-align: center; font-size: 16px; line-height: 1.45; font-weight: 590; }
.hint { font-size: 12.5px; line-height: 1.45; }
.px-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.px-thumb { width: 72px; height: 72px; object-fit: contain; background: var(--fill); border: 0; border-radius: 14px; }
.px-title { margin: 0 0 4px; font-size: 20px; font-weight: 650; letter-spacing: -0.03em; }
.px-kicker { margin: 0 0 4px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.px-kpis { margin-top: 0; }
.px-stats { margin-top: 8px; }
.px-badge {
  display: inline-block; margin-top: 6px; padding: 3px 8px; font-size: 11px;
  font-weight: 650; letter-spacing: 0.03em; text-transform: uppercase;
  border: 0; border-radius: 6px; background: var(--fill-2);
}
.px-high { background: var(--ok-bg); color: var(--ok); }
.px-medium { background: var(--warn-bg); color: var(--warn); }
.px-low, .px-none { background: var(--fill); color: var(--muted); }
.px-cheap td { background: #f0faf3; }
.px-box { margin-top: 12px; background: var(--fill); border: 0; border-radius: 12px; padding: 12px 14px; }
.px-box ol, .px-box ul { margin: 6px 0 0; padding-left: 18px; }
.px-box li { margin: 4px 0; font-size: 13px; }
.px-report { background: #fff; }
.px-scenarios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 12px; }
.px-scen { border: 1px solid var(--line); padding: 14px; background: var(--fill); border-radius: 14px; }
.px-scen.on { border-color: #1d1d1f; background: #fff; box-shadow: var(--shadow); }
.px-scen b { display: block; font-size: 11px; font-weight: 590; color: var(--muted); margin-bottom: 4px; }
.px-scen span { display: block; font-size: 22px; font-weight: 650; margin-bottom: 8px; letter-spacing: -0.03em; }
.px-scen-cap { margin: 8px 0 6px; }
.px-cov { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.px-chip { font-size: 11px; padding: 3px 8px; border: 0; background: var(--fill-2); border-radius: 6px; }
.px-chip.on { background: var(--ok-bg); }
.px-chip.off { color: var(--muted); background: var(--fill); }
.px-promo { color: var(--warn); font-size: 11px; margin-left: 4px; }
.px-audit { font-size: 12px; }
.market-box { margin-top: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cart li.just-added { outline: 2px solid #30d158; background: var(--ok-bg); }
.print-only { display: none; }
.nav-mask { display: none; }
.phone-url { font-size: 22px; font-weight: 650; letter-spacing: -0.03em; margin: 8px 0; word-break: break-all; }
.order-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.order-cards { display: none; }
.order-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 8px; }
.order-card .order-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.order-card.st-acik { border-left: 3px solid #ff9f0a; }
.order-card.st-siparis { border-left: 3px solid var(--blue); }
.order-card.st-geldi { border-left: 3px solid var(--ok); }
.order-card.st-iptal { border-left: 3px solid #86868b; opacity: 0.75; }
.inv-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inv-actions .btn input { display: none; }
.inv-preview { width: 100%; max-height: 240px; object-fit: contain; background: #111; border: 0; border-radius: 12px; }
.ocr-prog { background: var(--fill); border: 0; border-radius: 10px; padding: 8px; }
.ocr-prog div { height: 6px; width: 0; background: var(--blue); margin-bottom: 6px; border-radius: 99px; }
.inv-line { background: var(--fill); border: 0; border-radius: 14px; padding: 12px; margin: 8px 0; display: grid; gap: 8px; }
.inv-line.fresh { box-shadow: inset 3px 0 0 #ff9f0a; }
.inv-line.matched { box-shadow: inset 3px 0 0 var(--ok); }
.inv-head { display: flex; justify-content: space-between; align-items: center; }
.inv-head .skip { font-weight: 600; color: var(--muted); }

.receipt {
  width: 80mm;
  max-width: 100%;
  margin: 0 auto 16px;
  padding: 16px 14px 20px;
  background: #fff;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  font-family: "SF Mono", ui-monospace, "Consolas", monospace;
  font-size: 12px;
  color: #111;
}
.receipt-brand { margin: 0 0 4px; text-align: center; font-weight: 700; font-size: 15px; }
.receipt-meta { margin: 0; text-align: center; color: #333; }
.receipt-lines { width: 100%; border-collapse: collapse; margin: 8px 0; }
.receipt-lines td { padding: 2px 0; border: 0; vertical-align: top; }
.receipt-lines .right { text-align: right; }
.receipt-total td { border-top: 1px dashed #111; padding-top: 6px; font-weight: 700; }
.receipt-foot { text-align: center; margin: 10px 0 0; }

@media print {
  @page { size: 80mm auto; margin: 4mm; }
  body { padding: 0 !important; background: #fff; }
  .erp-top, .erp-side, .crumb, .crumb-actions, .toolbar, .no-print, .flash, .nav-mask { display: none !important; }
  .erp-main { padding: 0; }
  .print-only { display: block; }
  body.receipt-page .win { display: none !important; }
  .receipt { width: 72mm; border: 0; margin: 0; padding: 0; border-radius: 0; }
}
@media (max-width: 980px) {
  body { padding-left: 0; }
  .erp-top { gap: 8px; padding: 0 8px; overflow: hidden; flex-wrap: nowrap; }
  .brand { flex: 1 1 auto; }
  .brand small, .brand-name { display: none; }
  .erp-top a { flex: 0 0 auto; padding: 0 8px; white-space: nowrap; }
  .erp-side { transform: translateX(-105%); }
  body.nav-open .erp-side { transform: none; }
  body.nav-open .nav-mask {
    display: block; position: fixed; inset: var(--top-h) 0 0 0;
    background: rgba(0,0,0,0.32); z-index: 14;
    backdrop-filter: blur(2px);
  }
  .kpis, .modules { grid-template-columns: 1fr 1fr; }
  .px-scenarios { grid-template-columns: 1fr; }
  .filter.row, .grid-3 { grid-template-columns: 1fr 1fr; }
  .pay-actions { grid-template-columns: 1fr 1fr; }
  .who { display: none; }
  .erp-side a { padding: 11px 14px; font-size: 15px; }
  .btn, .ghost, .chip { min-height: 44px; padding: 10px 14px; font-size: 15px; }
  input, select, textarea { min-height: 44px; font-size: 16px; }
  .order-cards { display: block; }
  .order-table { display: none; }
  .order-acts .btn { flex: 1; }
  .crumb { flex-wrap: nowrap; align-items: center; gap: 8px; margin-bottom: 16px; }
  .crumb h1 { font-size: 22px; min-width: 0; flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .crumb-actions { flex: 0 0 auto; }
  .erp-main { padding: 16px 14px 28px; }
  .phone-url { font-size: 18px; }
  .kasa-toolbar { display: grid; grid-template-columns: 1fr; }
  .kasa-lookup { max-width: none; width: 100%; min-width: 0; }
  .kasa-toolbar #lookup { max-width: none; min-width: 0; width: 100%; }
  .kasa-toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .kasa-toolbar-actions select { grid-column: 1 / -1; }
  .cart li {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name name" "price qty";
    align-items: start;
  }
  .cart-name { grid-area: name; }
  .cart-price { grid-area: price; width: 100%; max-width: none; }
  .qty { grid-area: qty; justify-content: flex-end; flex-shrink: 0; }
  .qty input { width: 52px; min-height: 44px; }
  body.kasa-page { height: 100dvh; overflow: hidden; }
  body.kasa-page .erp-main {
    height: calc(100dvh - var(--top-h));
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 8px 8px 0;
  }
  body.kasa-page .crumb { flex: 0 0 auto; margin-bottom: 6px; }
  body.kasa-page .crumb h1 { font-size: 18px; }
  body.kasa-page .crumb-actions .btn { min-height: 36px; padding: 6px 12px; font-size: 13px; }
  body.kasa-page .kasa-layout {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  body.kasa-page .kasa-ticket {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    overflow: hidden;
  }
  body.kasa-page .kasa-ticket .win-cap,
  body.kasa-page .kasa-ticket .toolbar { flex: 0 0 auto; }
  body.kasa-page .kasa-ticket .win-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.kasa-page .paybox {
    position: relative;
    flex: 0 0 auto;
    z-index: 8;
    padding: 12px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    margin: 0 -8px 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
  }
  body.kasa-page .paybox label { margin-bottom: 0; }
  body.kasa-page .pay-fields { display: grid; grid-template-columns: 88px 1fr; gap: 8px; }
  body.kasa-page .pay-actions .btn {
    white-space: nowrap;
    font-size: 14px;
    padding: 8px 6px;
  }
  body.kasa-page .paybox .grid-3 { grid-template-columns: 1fr 1fr auto; }
  .card-pop { place-items: end center; padding: 0; }
  .card-pop .win, .pos-sheet { width: 100%; border-radius: 20px 20px 0 0; }
  .scan-frame { height: 104px; }
}
@media (max-width: 620px) {
  .kpis, .modules, .grid-2, .grid-3, .filter.row, .px-scenarios { grid-template-columns: 1fr; }
  .pay-actions { grid-template-columns: 1fr 1fr; }
  .erp-top .firma { display: none; }
  .win-cap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.kasa-page .paybox .grid-3 { grid-template-columns: 1fr 1fr; }
  body.kasa-page .paybox .grid-3 .btn { grid-column: 1 / -1; }
}

body.site-page {
  padding: 0;
  background: var(--bg);
}
.site-top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 28px;
  background: rgba(251, 251, 253, 0.86);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.site-brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); font-weight: 650; font-size: 15px;
  text-decoration: none; letter-spacing: -0.03em;
}
.site-brand img { width: 28px; height: 28px; border-radius: 7px; }
.site-nav { display: flex; align-items: center; gap: 18px; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 500; }
.site-nav a:hover { text-decoration: none; opacity: 0.7; }
.site-main { max-width: 920px; margin: 0 auto; padding: 48px 24px 80px; }
.site-hero { padding: 32px 0 48px; }
.site-kicker {
  margin: 0 0 12px; font-size: 12px; font-weight: 650;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.site-hero h1 {
  margin: 0 0 16px; font-size: 48px; font-weight: 650;
  letter-spacing: -0.045em; line-height: 1.08;
}
.site-lead { margin: 0 0 24px; font-size: 19px; color: var(--muted); max-width: 34em; line-height: 1.45; }
.site-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.site-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin: 12px 0 48px;
}
.site-grid article {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px;
}
.site-grid h2 { margin: 0 0 8px; font-size: 17px; letter-spacing: -0.02em; }
.site-grid p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.site-steps, .site-wait {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px; margin-bottom: 16px;
}
.site-steps h2, .site-wait h2 { margin: 0 0 12px; font-size: 24px; letter-spacing: -0.03em; }
.site-steps ol { margin: 0 0 14px; padding-left: 18px; }
.site-steps li { margin: 6px 0; }
.site-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.site-form button { grid-column: 1 / -1; justify-self: start; min-width: 160px; }
.site-form label:has(textarea) { grid-column: 1 / -1; }
.site-form textarea { min-height: 88px; resize: vertical; }
.site-foot { padding: 24px; text-align: center; color: var(--muted); font-size: 12px; }
.site-foot-links { display: flex; flex-wrap: wrap; gap: 12px 18px; justify-content: center; margin: 10px 0 0; }
.site-foot-links a { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-foot-links a:hover { text-decoration: underline; }
.legal-main h1 {
  margin: 0 0 16px; font-size: 36px; font-weight: 650;
  letter-spacing: -0.04em; line-height: 1.1;
}
.legal-block {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 14px;
}
.legal-block h2 { margin: 0 0 10px; font-size: 17px; letter-spacing: -0.02em; }
.legal-block p, .legal-block li { font-size: 14px; line-height: 1.5; color: var(--ink); }
.legal-block ul { margin: 0; padding-left: 18px; }
.legal-block li { margin: 6px 0; }
.legal-block code { font-size: 12px; background: var(--fill); padding: 1px 5px; border-radius: 4px; }
.login-brand a { text-decoration: none; }

body.platform-login .platform-kicker {
  color: #d70015;
  letter-spacing: 0.14em;
}
body.platform-page {
  padding: 0;
  background: var(--bg);
}
.platform-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  min-height: 52px; padding: 8px 18px;
  background: #1d1d1f;
  color: #f5f5f7;
}
.platform-badge {
  flex: 0 0 auto;
  font-size: 11px; font-weight: 650; letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 6px;
}
.platform-brand {
  color: #f5f5f7; font-weight: 650; font-size: 15px;
  letter-spacing: -0.03em; text-decoration: none;
}
.platform-brand:hover { text-decoration: none; opacity: 0.85; }
.platform-nav {
  display: flex; flex-wrap: wrap; gap: 12px 16px;
  flex: 1 1 auto; font-size: 13px;
}
.platform-nav a { color: #d2d2d7; text-decoration: none; font-weight: 500; }
.platform-nav a:hover { color: #fff; text-decoration: none; }
.platform-top form { margin: 0; }
.platform-out {
  background: transparent; color: #f5f5f7;
  border: 1px solid rgba(255,255,255,0.28);
  min-height: 34px; padding: 6px 12px; font-size: 13px;
}
.platform-out:hover { background: rgba(255,255,255,0.08); }
.platform-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}
.platform-main h1 {
  margin: 0 0 8px; font-size: 32px; font-weight: 650;
  letter-spacing: -0.035em;
}
.platform-main .kpis { margin-top: 16px; }
.platform-main table.grid td form { margin: 0; }
.platform-main table.grid .btn { min-height: 32px; padding: 4px 10px; font-size: 12px; }
.platform-shop-form {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: end;
  padding: 8px 0 12px;
}
.platform-shop-form label { margin: 0; min-width: 140px; }
.platform-shop-form .platform-check {
  display: inline-flex; flex-direction: row; align-items: center; gap: 6px;
  min-width: auto; font-size: 13px; color: var(--ink);
}
.platform-shop-form .platform-check input { width: auto; }
.sorgula-props {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;
  margin: 16px 0 0;
}
.sorgula-props div { display: grid; gap: 2px; }
.sorgula-props dt { font-size: 11px; color: var(--muted); font-weight: 590; }
.sorgula-props dd { margin: 0; font-size: 14px; font-weight: 590; }
body.sorgula-page .erp-main {
  height: calc(100dvh - var(--top-h));
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 8px 8px 0;
}
body.sorgula-page .crumb { flex: 0 0 auto; margin-bottom: 6px; }
body.sorgula-page .sorgula-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.sorgula-page .sorgula-result {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  overflow: hidden;
}
body.sorgula-page .sorgula-result .win-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.sorgula-dock {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  margin: 0 -8px 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
  z-index: 8;
}
.sorgula-dock .kasa-lookup { flex: 1; max-width: none; }
.sorgula-dock-actions { display: flex; gap: 8px; flex: 0 0 auto; }
@media (max-width: 620px) {
  .sorgula-dock { flex-direction: column; align-items: stretch; }
  .sorgula-dock-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .sorgula-props { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .site-hero h1 { font-size: 34px; }
  .site-grid, .site-form { grid-template-columns: 1fr; }
  .site-nav a:not(.btn) { display: none; }
  .site-top { padding: 12px 16px; }
  .site-main { padding: 28px 16px 64px; }
  .platform-nav { display: none; }
  .platform-main { padding: 20px 14px 56px; }
  .platform-main .kpis { grid-template-columns: 1fr 1fr; }
}
.help-dock {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
body.sorgula-page .help-dock { bottom: 96px; }
.help-dock > * { pointer-events: auto; }
.help-fabs { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.help-fab {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  border: 0; text-decoration: none; color: #fff;
  cursor: pointer;
}
.help-bot { background: var(--ink); }
.help-wa { background: var(--ok); }
.help-panel {
  width: min(400px, calc(100vw - 32px));
  max-height: min(78dvh, 560px);
  background: var(--win);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.help-panel-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--line);
}
.help-panel-top strong { font-size: 14px; }
.help-panel-top span { grid-column: 1; font-size: 12px; color: var(--muted); }
.help-close {
  grid-row: 1 / span 2; grid-column: 2;
  border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer;
}
.help-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.help-bubble {
  margin: 0; padding: 8px 10px; border-radius: 12px; font-size: 13px; line-height: 1.4; max-width: 92%;
  white-space: pre-wrap;
}
.help-bubble.bot { background: var(--fill); align-self: flex-start; }
.help-bubble.me { background: var(--sel); align-self: flex-end; }
.help-bubble.pending { color: var(--muted); }
.help-form {
  display: flex; gap: 8px; padding: 10px;
  border-top: 1px solid var(--line);
}
.help-form input { flex: 1; min-width: 0; margin: 0; }
.help-form .btn { flex: 0 0 auto; min-height: 36px; }
body.platform-page .help-panel { background: #2c2c2e; border-color: rgba(255,255,255,0.12); color: #f5f5f7; }
body.platform-page .help-bubble.bot { background: #3a3a3c; }
body.platform-page .help-panel-top { border-color: rgba(255,255,255,0.12); }
body.platform-page .help-form { border-color: rgba(255,255,255,0.12); }

