:root {
  --bg: #f4f3f1; --card: #fff; --ink: #1d1a16; --muted: #756d63; --line: #e7e1d8;
  --brand: #111111; --accent: #ff7709; --accent-ink: #1a0b00; --accent-text: #c25400;
  --green: #1f8a4c; --red: #c0392b; --amber: #b7791f;
  --radius: 12px; --shadow: 0 1px 2px rgba(20,33,61,.06), 0 4px 14px rgba(20,33,61,.05);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent-text); }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; margin: 1.6rem 0 .6rem; }
h3 { margin: 0 0 .6rem; font-size: 1.05rem; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; width: 100%; padding-top: 20px; padding-bottom: 40px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.green { color: var(--green); } .red { color: var(--red); } .amber { color: var(--amber); }
.inline { display: inline; margin: 0; }

/* Üst bar */
.topbar { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar-in { display: flex; align-items: center; gap: 18px; min-height: 60px; }
.brand { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; margin-right: auto; }
.brand small { display: block; font-weight: 400; font-size: .72rem; opacity: .7; }
.logo { width: 44px; height: 44px; border-radius: 50%; display: block; }
.hero-logo { width: 150px; height: 150px; border-radius: 50%; display: block; margin-bottom: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a, .nav .linkbtn { color: #dfe5f0; text-decoration: none; padding: 7px 11px; border-radius: 8px; font-size: .92rem; }
.nav a:hover, .nav .linkbtn:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.on { background: rgba(255,119,9,.18); color: #ff9a4a; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; }
.cart-btn { background: var(--accent); color: var(--accent-ink); text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.cart-btn .pill { background: var(--brand); color: #fff; }
.pill { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .75rem; text-align: center; font-weight: 700; }
.pill.warn { background: #ff7a59; color: #fff; }
.pill[hidden] { display: none; }
.announce { background: var(--accent); color: var(--accent-ink); font-weight: 600; padding: 8px 0; font-size: .92rem; }
.foot { color: var(--muted); font-size: .85rem; padding: 18px 0; border-top: 1px solid var(--line); }
.foot .wrap { display: flex; gap: 18px; flex-wrap: wrap; }
.wa { position: fixed; right: 18px; bottom: 18px; width: 54px; height: 54px; border-radius: 50%; background: #25d366; display: grid; place-items: center; font-size: 1.6rem; text-decoration: none; box-shadow: 0 6px 18px rgba(0,0,0,.2); }

@media (max-width: 900px) {
  .nav-toggle { display: block; order: 3; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 60px; background: var(--brand); flex-direction: column; align-items: stretch; padding: 8px 16px 14px; }
  body.nav-open .nav { display: flex; }
  .cart-btn span { display: none; }
}

/* Kart, form, buton */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.flush { padding: 0; overflow-x: auto; }
.narrow { max-width: 640px; margin: 10px auto; }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 12px; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 9px 11px; font: inherit; border: 1px solid #d4ccc0; border-radius: 9px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid #ffb27a; border-color: var(--accent); }
label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
label.check input { width: auto; margin-top: 3px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }
@media (max-width: 700px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 15px; border-radius: 9px; border: 1px solid #d4ccc0; background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #b9ad9c; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #2b2b2b; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--red); border-color: #e9b8b1; }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn.block { width: 100%; } .btn.big { padding: 13px; font-size: 1.05rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; font: inherit; cursor: pointer; color: inherit; padding: 4px; }
.alert { padding: 11px 14px; border-radius: 9px; margin-bottom: 14px; }
.alert.ok { background: #e6f5ec; color: #145c33; border: 1px solid #b9e2c9; }
.alert.err { background: #fdecea; color: #8a2318; border: 1px solid #f3c2bc; }
.alert.big { font-size: 1.05rem; }
.alert[hidden] { display: none; }
.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head p { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.search { display: flex; gap: 8px; min-width: min(100%, 380px); }
.search input { margin: 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 800px) { .cols { grid-template-columns: 1fr; } }

/* Giriş */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; min-height: 70vh; }
.auth-hero h1 { font-size: 2.4rem; line-height: 1.15; }
.auth-hero h1 span { color: var(--accent-text); }
.checks { list-style: none; padding: 0; font-size: 1.05rem; }
.checks li { padding: 6px 0 6px 30px; position: relative; }
.checks li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.auth-card { max-width: 420px; width: 100%; justify-self: center; }
.auth.solo { grid-template-columns: 1fr; }
.auth.solo .hero-logo { width: 90px; height: 90px; margin: 0 auto 10px; }
.auth.solo h2 { text-align: center; }
@media (max-width: 800px) { .auth { grid-template-columns: 1fr; gap: 10px; } .auth-hero h1 { font-size: 1.7rem; } }

/* Katalog */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { padding: 6px 13px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .9rem; }
.chip small { color: var(--muted); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.on small { color: #bbb; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.product { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.product.out { opacity: .65; }
.pimg { aspect-ratio: 16/10; background: linear-gradient(135deg, #262626, #0d0d0d); position: relative; display: grid; place-items: center; }
.pimg img { width: 100%; height: 100%; object-fit: cover; }
.pimg span { font-size: 3rem; color: rgba(255,119,9,.45); font-weight: 800; }
.pimg .tag { position: absolute; left: 10px; top: 10px; background: var(--accent); color: var(--accent-ink); font-style: normal; font-weight: 700; font-size: .75rem; padding: 3px 9px; border-radius: 999px; }
.pbody { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pbody h3 { margin: 0; font-size: 1rem; }
.pdesc { margin: 0; font-size: .84rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { margin-top: auto; padding-top: 6px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price s { color: var(--muted); font-size: .85rem; }
.price b { font-size: 1.25rem; }
.price small { color: var(--muted); font-size: .78rem; }
.bulk { font-size: .82rem; color: var(--accent-text); }
.stock { font-size: .82rem; min-height: 1em; }
.buy { display: flex; gap: 8px; margin-top: 6px; }
.buy .btn { flex: 1; }
.incart { font-size: .8rem; }
@media (max-width: 600px) {
  .products { grid-template-columns: 1fr; gap: 10px; }
  .product { flex-direction: row; }
  .pimg { width: 92px; min-width: 92px; aspect-ratio: auto; }
  .pimg span { font-size: 2rem; }
  .pimg .tag { left: 4px; right: 4px; top: 4px; font-size: .62rem; padding: 2px 4px; text-align: center; }
  .pbody { padding: 10px 12px; }
  .pdesc { display: none; }
  .price b { font-size: 1.1rem; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .chip { white-space: nowrap; }
}
.stepper { display: flex; border: 1px solid #d4ccc0; border-radius: 9px; overflow: hidden; background: #fff; }
.stepper button { border: 0; background: #f4f1ec; width: 32px; font-size: 1.1rem; cursor: pointer; }
.stepper input { width: 52px; border: 0; border-radius: 0; margin: 0; text-align: center; padding: 8px 2px; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper.sm { display: inline-flex; }
.stepper.sm input { width: 46px; padding: 5px 2px; }
.stepper.sm button { width: 28px; }

/* Tablolar */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #faf8f5; font-weight: 600; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table tr.unseen td { background: #fff3e8; }
.rowlink { cursor: pointer; } .rowlink:hover td { background: #faf8f5; }
.cart-table td:first-child { min-width: 220px; }
[hidden] { display: none !important; }
.guest-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: #fff5ec; border: 1px solid #ffd2ad; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; }
.wa-btn { background: #25d366; border-color: #25d366; color: #fff; }
.wa-btn:hover { background: #1ebe5b; border-color: #1ebe5b; }
.src-tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #eee; color: #555; vertical-align: middle; }
.stock-forms { grid-template-columns: 1fr 1fr; }
@media (max-width: 800px) { .stock-forms { grid-template-columns: 1fr; } }
.table.receive th, .table.receive td { padding: 6px 4px; }
.table.receive td:first-child { width: 100%; }
.table.receive td:nth-child(2) input { width: 70px; }
.table.receive td:nth-child(3) input { width: 105px; }
.hint { font-size: .8rem; color: var(--accent-text); margin-top: 3px; }
.hint.ok { color: var(--green); }

.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #eee; white-space: nowrap; }
.s-yeni { background: #fff1cc; color: #7a5500; }
.s-onaylandi { background: #e3edff; color: #1c4fa0; }
.s-hazirlaniyor { background: #efe5ff; color: #5b2ea6; }
.s-yolda { background: #dff4f7; color: #0d6470; }
.s-teslim { background: #e6f5ec; color: #145c33; }
.s-iptal { background: #f3f0ec; color: #8a8178; text-decoration: line-through; }
.s-pending { background: #fff1cc; color: #7a5500; } .s-active { background: #e6f5ec; color: #145c33; } .s-passive { background: #f3f0ec; color: #8a8178; }

/* Sepet */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.summary { position: sticky; top: 76px; }
@media (max-width: 950px) { .cart-layout { grid-template-columns: 1fr; } .summary { position: static; } }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0 0 14px; }
.totals dt { color: var(--muted); } .totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.totals .grand { font-size: 1.15rem; font-weight: 800; color: var(--ink); padding-top: 8px; border-top: 1px solid var(--line); }
dl.card.totals { padding: 18px; }
.info { display: grid; grid-template-columns: 130px 1fr; gap: 6px 10px; margin: 0; }
.info dt { color: var(--muted); } .info dd { margin: 0; }

/* Sipariş takip */
.track { display: flex; list-style: none; padding: 0; margin: 0 0 18px; counter-reset: s; }
.track li { flex: 1; text-align: center; font-size: .82rem; color: var(--muted); position: relative; padding-top: 30px; }
.track li::before { counter-increment: s; content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; background: #e2ddd4; color: #fff; display: grid; place-items: center; font-weight: 700; z-index: 1; }
.track li::after { content: ''; position: absolute; top: 11px; left: -50%; width: 100%; height: 3px; background: #e2ddd4; }
.track li:first-child::after { display: none; }
.track li.done { color: var(--ink); font-weight: 600; }
.track li.done::before, .track li.done::after { background: var(--green); }

/* İstatistik */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); text-decoration: none; color: inherit; }
.stat small { color: var(--muted); display: block; font-size: .8rem; }
.stat b { display: block; font-size: 1.5rem; margin: 2px 0; font-variant-numeric: tabular-nums; }
.stat span { font-size: .82rem; color: var(--muted); }
.stat.bad b { color: var(--red); } .stat.good b { color: var(--green); }
.stat.hot { border-color: var(--accent); background: #fff5ec; }
.bank pre { white-space: pre-wrap; font: inherit; margin: 6px 0; }

/* Toast */
#toasts { position: fixed; right: 16px; top: 76px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.toast { display: block; background: var(--brand); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); text-decoration: none; transition: opacity .3s, transform .3s; border-left: 4px solid var(--green); }
.toast.err { border-left-color: #ff6b5b; }
.toast.big { border-left-color: var(--accent); font-weight: 700; font-size: 1.05rem; }
.toast.hide { opacity: 0; transform: translateX(20px); }

.prose p { line-height: 1.6; }
details.card summary { cursor: pointer; font-weight: 700; }
details.card[open] summary { margin-bottom: 14px; }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #eee; display: block; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row-actions form { margin: 0; }
.row-actions select { width: auto; margin: 0; padding: 6px 8px; }
code.code { background: #f1ede6; padding: 2px 7px; border-radius: 6px; font-weight: 700; }

/* Yazdırma: hazırlık fişi / ekstre */
@media print {
  .topbar, .foot, .actions, .wa, #toasts, .no-print, .announce, .page-head .btn, form, .track { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .main { padding: 0; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* Fiyat girişi (admin ürün listesi) */
.alert.warn-box { background: #fff4e5; color: #7a4100; border: 1px solid #ffd59e; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.alert.warn-box > span { flex: 1 1 280px; }
.alert.warn-box .btn { margin-left: auto; }
.np-tag { font-style: normal; font-size: .72rem; font-weight: 700; color: #a34b00; background: #fff1e0; border-radius: 999px; padding: 1px 8px; }
tr.no-price input[name="price"] { border-color: var(--accent); background: #fffaf3; }
form.quick.saved input { border-color: #2e9d5b; background: #effaf3; }
form.quick.failed input { border-color: #c0392b; background: #fdecea; }
.ask-price { color: var(--accent-text); font-weight: 700; }
.price b.ask-price { font-size: 1rem; }
