:root {
  --brand: #b5532a;
  --bg: #f5f5f4;
  --card: #fff;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --soft: #fafaf9;
  --danger: #c2410c;
  --ok: #15803d;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2 { margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
label { display: block; font-weight: 500; font-size: 14px; margin: 14px 0 0; }
input, textarea, select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); font: 16px Inter, sans-serif; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
textarea { resize: vertical; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 10px 16px; border-radius: 10px; font: 600 14px Inter, sans-serif; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(.95); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(0, 0, 0, .05); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.block { width: 100%; margin-top: 18px; padding: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.err { color: var(--danger); font-size: 14px; min-height: 0; margin-top: 10px; }
.err:empty { display: none; }

/* Giriş */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 18px; padding: 28px 24px; box-shadow: 0 10px 40px rgba(0, 0, 0, .08); }
.brand-mark { width: 48px; height: 48px; border-radius: 12px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; margin-bottom: 16px; }
.login-card h1 { font-size: 22px; }

/* Üst bar */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in, .tabs, .main { max-width: 820px; margin: 0 auto; }
.top-in { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 16px 4px; }
.biz { display: flex; align-items: center; gap: 8px; min-width: 0; }
.biz strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
.biz-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); flex: none; }
.top-actions { display: flex; gap: 2px; flex: none; }
.tabs { display: flex; gap: 4px; padding: 0 10px; }
.tabs button { border: 0; background: none; padding: 12px 10px; font: 600 14px Inter, sans-serif; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--brand); }

.main { padding: 16px 16px 80px; }
.bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.bar p { margin: 0; }
.card { background: var(--card); border-radius: 14px; border: 1px solid var(--line); padding: 18px; margin-bottom: 16px; }

/* Kategoriler ve ürünler */
.cat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 16px; overflow: hidden; }
.cat-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 16px; background: var(--soft); border-bottom: 1px solid var(--line); }
.cat-head h3 { flex: 1; margin: 0; font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-head .count { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 4px; }
.icon { width: 34px; height: 34px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--muted); display: inline-grid; place-items: center; font-size: 16px; flex: none; }
.icon:hover { background: rgba(0, 0, 0, .06); color: var(--ink); }
.icon.danger:hover { color: var(--danger); }
.icon:disabled { opacity: .3; cursor: default; background: none; }

.prod { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-top: 1px solid var(--line); }
.prod:first-child { border-top: 0; }
.prod.off .p-name { color: var(--muted); text-decoration: line-through; }
.thumb { width: 56px; height: 56px; flex: none; border-radius: 10px; border: 1px dashed #d6d3d1; background: var(--soft) center/cover no-repeat; cursor: pointer; display: grid; place-items: center; color: var(--muted); font-size: 20px; padding: 0; }
.thumb.has { border-style: solid; border-color: transparent; }
.p-info { flex: 1; min-width: 0; cursor: pointer; }
.p-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edit-hint { color: var(--muted); font-weight: 400; font-size: 13px; display: none; }
@media (max-width: 620px) { .edit-hint { display: inline; } }
.p-desc { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price-in { width: 96px; flex: none; margin: 0; padding: 8px 10px; text-align: right; font-weight: 600; }
.price-wrap { position: relative; flex: none; }
.price-wrap::after { content: "₺"; position: absolute; right: -14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.price-wrap { margin-right: 14px; }
.prices2 { display: flex; gap: 6px; flex: none; }
.pl { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.price-in.sm { width: 70px; }
.sz-btn { width: auto; padding: 0 8px; font-size: 12px; font-weight: 600; }
.sz-btn.on { color: var(--brand); }
.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #d6d3d1; border-radius: 999px; cursor: pointer; transition: .15s; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(16px); }
.p-actions { display: flex; flex: none; }
.add-prod { display: block; width: 100%; border: 0; border-top: 1px solid var(--line); background: none; padding: 12px; font: 600 14px Inter, sans-serif; color: var(--brand); cursor: pointer; }
.add-prod:hover { background: var(--soft); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }

@media (max-width: 620px) {
  .bar p { display: none; }
  .bar { justify-content: flex-end; }
  .prod { flex-wrap: wrap; row-gap: 8px; }
  .p-info { flex-basis: calc(100% - 68px); }
  .price-in { width: 88px; }
  .p-actions { margin-left: auto; }
  .p-actions .edit-btn { display: none; }
  .price-in.sm { width: 62px; }
  .prod .icon { width: 30px; }
}

/* QR */
.qr-card { display: flex; gap: 24px; align-items: center; }
.qr-card img { width: 220px; height: 220px; flex: none; border-radius: 12px; border: 1px solid var(--line); }
.link-row { display: flex; gap: 8px; margin: 14px 0; align-items: center; }
.link-row input { margin: 0; font-size: 14px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 620px) { .qr-card { flex-direction: column; text-align: center; } .qr-card img { width: 240px; height: 240px; } .row-btns { justify-content: center; } }

/* Ayarlar */
.logo-row { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.logo-box { width: 72px; height: 72px; border-radius: 50%; border: 1px dashed #d6d3d1; background: var(--soft) center/cover no-repeat; cursor: pointer; color: var(--muted); font-size: 22px; }
.color-row input { width: 64px; height: 40px; padding: 2px; }

/* Ürün diyaloğu */
dialog { border: 0; border-radius: 16px; padding: 22px; width: min(480px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); max-height: calc(100vh - 24px); }
dialog::backdrop { background: rgba(0, 0, 0, .4); }
.photo-edit { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.photo-box { width: 96px; height: 96px; border-radius: 12px; border: 1px dashed #d6d3d1; background: var(--soft) center/cover no-repeat; cursor: pointer; color: var(--muted); font-size: 24px; flex: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check input { width: auto; margin: 0; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 500; z-index: 50; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); max-width: calc(100vw - 32px); }
.toast.bad { background: var(--danger); }
