:root {
  --bg: #f4f5f7; --card: #fff; --text: #1d2330; --muted: #6b7280; --line: #e5e7eb;
  --brand: #f27a1a; --brand-d: #d9650b; --side: #1d2330; --ok: #15803d; --ok-bg: #dcfce7;
  --err: #b91c1c; --err-bg: #fee2e2; --warn: #92400e; --warn-bg: #fef3c7;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 system-ui, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--brand-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0; }

.layout { display: flex; min-height: 100vh; }
.sidebar { width: 230px; flex-shrink: 0; background: var(--side); color: #cbd2dc; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 20px 18px; font-weight: 700; font-size: 17px; color: #fff; }
.brand span { display: block; font-weight: 400; font-size: 12px; color: #9aa3b2; }
.brand-dark { color: var(--text); padding: 0 0 12px; }
.sidebar nav { flex: 1; display: flex; flex-direction: column; padding: 0 10px; overflow-y: auto; }
.sidebar nav a, .nav-soon { padding: 8px 10px; border-radius: 6px; color: #cbd2dc; }
.sidebar nav a:hover { background: #2b3344; text-decoration: none; }
.sidebar nav a.on { background: var(--brand); color: #fff; }
.nav-soon { opacity: .45; cursor: default; }
.nav-soon small { font-size: 10px; margin-left: 4px; }
.nav-sep { margin: 14px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #7d8696; }
.logout { padding: 14px 18px; border-top: 1px solid #2b3344; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.btn-link { background: none; border: 0; color: #f8b27a; cursor: pointer; font: inherit; padding: 0; }

.content { flex: 1; padding: 24px 28px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.card.muted { color: var(--muted); }
.table-card { padding: 0; overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafafa; }
tbody tr:hover { background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }
.row-off td { opacity: .6; }
.sub { font-size: 12px; color: var(--muted); }
.mono { font-family: ui-monospace, Consolas, monospace; }
.small { font-size: 12px; max-width: 260px; word-break: break-word; }
.nowrap { white-space: nowrap; }
.actions { white-space: nowrap; text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 32px; }

.btn { display: inline-block; padding: 7px 14px; border: 1px solid var(--line); background: #fff; border-radius: 7px; color: var(--text); cursor: pointer; font: inherit; }
.btn:hover { background: #f3f4f6; text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-d); }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 8px; padding: 10px; }
.btn[disabled] { opacity: .5; cursor: wait; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; background: #eef0f3; color: #4b5563; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-err { background: var(--err-bg); color: var(--err); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: var(--ok-bg); color: var(--ok); }
.flash-err { background: var(--err-bg); color: var(--err); }

.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 7px; background: #fff; width: 100%; }
.filters input, .filters select { width: auto; min-width: 180px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #fbd0ac; border-color: var(--brand); }

.form { max-width: 760px; }
.form label { display: block; margin-bottom: 14px; font-weight: 500; }
.form label input, .form label select, .form label textarea { margin-top: 4px; font-weight: 400; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 0; margin: 0 0 14px; }
.form legend { font-weight: 600; padding: 0 6px; }
.form legend small { font-weight: 400; color: var(--muted); }
.check { display: flex !important; gap: 8px; align-items: center; }
.check input { width: auto; margin: 0 !important; }
.err { display: block; color: var(--err); font-style: normal; font-size: 12px; margin-top: 3px; font-weight: 400; }
.hint { display: block; color: var(--muted); font-style: normal; font-size: 12px; margin-top: 3px; font-weight: 400; }
p.hint { margin: 0 0 10px; }
.form-actions { display: flex; gap: 8px; margin-top: 6px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; color: var(--text); }
.stat:hover { text-decoration: none; border-color: var(--brand); }
.stat b { display: block; font-size: 26px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat-bad b { color: var(--err); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; }
.login-card label { display: block; margin-bottom: 12px; font-weight: 500; }
.login-card input { margin-top: 4px; }

.htmx-indicator { display: none; color: var(--muted); font-size: 12px; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }
.htmx-request .status-body { display: none; }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .nav-soon, .nav-sep { display: none; }
  .content { padding: 16px; }
  .form .row { grid-template-columns: 1fr; }
}

/* ---- Modül 2: siparişler ---- */
h3 { font-size: 14px; margin: 0 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.muted-num { font-size: 14px; color: var(--muted); font-weight: 400; }
.back { color: var(--muted); margin-right: 4px; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-new { background: #ffedd5; color: #c2410c; }
.num { text-align: right; }
.prod { max-width: 340px; }
tr.clickable { cursor: pointer; }
label.inline { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
label.inline input { width: auto; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--brand-d); border-bottom-color: var(--brand); font-weight: 600; }
.tabs a b { font-weight: 500; background: #eef0f3; color: #4b5563; border-radius: 99px; padding: 0 7px; font-size: 12px; margin-left: 2px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 8px 0 20px; color: var(--muted); }
.sync-card { padding: 0; }
.sync-card summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; }
.sync-card summary::-webkit-details-marker { display: none; }
.sync-card summary > span:first-child { font-weight: 600; }
.sync-card summary .sub { flex: 1; }
.sync-card table { border-top: 1px solid var(--line); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > .card { margin-bottom: 16px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0 0 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 4px 0 4px 14px; border-left: 2px solid var(--line); }
.timeline li span { color: var(--muted); font-size: 12px; margin-right: 8px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } .kv { grid-template-columns: 110px 1fr; } }

/* ---- Modül 3: ürünler ---- */
.head-actions { display: flex; gap: 8px; align-items: center; }
.pop { position: relative; }
.pop summary { list-style: none; }
.pop summary::-webkit-details-marker { display: none; }
.pop-body { position: absolute; right: 0; top: 110%; z-index: 10; width: 340px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.08); display: grid; gap: 10px; }
.bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; }
.bulk select, .bulk input:not([type=radio]):not([type=checkbox]) { width: auto; }
.bulk .sep { width: 1px; height: 24px; background: var(--line); }
.w-80 { width: 80px !important; }
.w-100 { width: 100px !important; }
.w-check { width: 32px; }
.w-img { width: 48px; }
.w-img img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.products td { vertical-align: middle; }
tr.editing { background: #fff8f1; }
tr.editing input { padding: 5px 8px; text-align: right; }
.txt-err { color: var(--err); }
.txt-warn { color: var(--warn); }
.txt-ok { color: var(--ok); }
tr.row-err td { background: #fff5f5; }
.job-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.confirm { border-color: var(--brand); background: #fffaf5; }
.confirm p { margin: 0 0 8px; }
.confirm-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 10px; }

/* Ana ürün kataloğu */
h2 { font-size: 17px; margin: 22px 0 10px; }
.inline-form { display: inline; margin: 0; }
.master { padding: 14px 16px; }
.master-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.master-img img, .master-img { width: 56px; height: 56px; border-radius: 8px; }
.master-img { background: #f3f4f6; flex-shrink: 0; overflow: hidden; }
.master-img img { object-fit: cover; display: block; }
.master-title { flex: 1 1 280px; min-width: 0; }
.master-facts { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.listings { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-left: 70px; }
.listing { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 150px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: #fafafa; font-size: 13px; }
.listing:hover { border-color: var(--brand); background: #fff8f1; }
.listing-store { color: var(--brand-d); font-weight: 600; }
.big-num { font-size: 22px; margin: 0 4px; }
.pad { padding: 14px 16px 0; margin: 0; }
.pending-push { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.danger-zone { margin-top: 28px; text-align: right; }
.w-wide { width: 100%; max-width: 520px; margin-bottom: 10px; }
.check span { font-weight: normal; }
@media (max-width: 700px) {
  .listings { padding-left: 0; }
  .listing { min-width: calc(50% - 4px); }
}

/* Kargo etiketi */
.label-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.head-actions .btn { white-space: nowrap; }

/* PraPazar düzeni: ⋮ menüler, pazaryeri düğmeleri, satış rozetleri, açılır pencere */
.title-line { display: flex; align-items: center; gap: 4px; }
.master-name { font-weight: 600; font-size: 15px; }
.master-img { position: relative; overflow: visible; }
.master-img img { border-radius: 8px; }
.sold-badge { position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--ok); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.fact { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.fact:first-child { border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; }
.ico-bc { width: 14px; height: 12px; background: repeating-linear-gradient(90deg, #374151 0 1px, transparent 1px 2px, #374151 2px 4px, transparent 4px 5px); }
.mp-buttons { display: inline-flex; gap: 6px; }
.mp-btn { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; cursor: pointer; list-style: none; user-select: none; flex-shrink: 0; }
.mp-btn::-webkit-details-marker { display: none; }
.mp-trendyol { border: 2px solid var(--brand); color: var(--brand); background: #fff; }
summary.mp-trendyol:hover { background: #fff3e8; }
.mp-sm { width: 24px; height: 24px; font-size: 12px; cursor: default; }

details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.kebab { cursor: pointer; padding: 0 6px; font-size: 18px; line-height: 1; color: var(--brand-d); border-radius: 4px; user-select: none; }
.kebab:hover { background: #fff3e8; }
.menu-list { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 220px; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); padding: 4px 0; }
.menu-right { left: auto; right: 0; }
.menu-list form { margin: 0; }
.menu-list a, .menu-list button, .menu-disabled { display: block; width: 100%; text-align: left; padding: 8px 14px; background: none;
  border: 0; font: inherit; color: var(--text); cursor: pointer; white-space: nowrap; }
.menu-list a:hover, .menu-list button:hover { background: #f3f4f6; }
.menu-head { padding: 8px 14px; font-weight: 700; border-bottom: 1px solid var(--line); }
.menu-disabled { color: var(--muted); cursor: default; border-bottom: 1px solid var(--line); }

.listing { flex-direction: row; align-items: center; gap: 8px; position: relative; min-width: 220px; justify-content: flex-start; }
.listing-body { flex: 1; text-align: center; }
.listing .sold-badge { top: -9px; right: 22px; }
/* Saydamlık yalnızca içeriğe: kartın tamamına verilirse ⋮ menüsü kartın içinde kalıp alttakilerin arkasına düşer. */
.listing-off > .mp-btn, .listing-off > .listing-body { opacity: .75; }
.listing:has(details[open]), .master-head:has(details[open]) { position: relative; z-index: 40; }
.state-ok { color: var(--ok); font-weight: 600; }
.state-warn { color: var(--warn); font-weight: 600; }
.state-err { color: var(--err); font-weight: 600; }

.modal { border: 0; border-radius: 12px; padding: 0; width: min(560px, 94vw); box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal::backdrop { background: rgba(17, 24, 39, .45); }
#modal-body { padding: 0; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-form, .modal-content { padding: 16px 18px; }
.val-btn { border: 0; background: none; padding: 0 2px; font: inherit; color: inherit; cursor: pointer; border-radius: 4px; }
.val-btn:hover { background: #fde7d2; text-decoration: underline dotted; }
.inline-name { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.inline-name label { flex: 1; }
.listing-name { color: var(--muted, #6b7280); max-width: 200px; }
.modal:has(.modal-wide) { width: min(780px, 96vw); }
.modal { max-height: 92vh; overflow: auto; }
/* Öneri listesi (app.js, data-suggest): tarayıcının datalist okunu göstermemek için kendi listemiz. */
.suggest { position: relative; display: block; }
.suggest-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px); margin: 0; padding: 4px 0; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.suggest-list li { padding: 7px 12px; cursor: pointer; }
.suggest-list li:hover, .suggest-list li.on { background: #fff3e8; }

/* Rekabet (buybox) rozeti */
.bb-badge { display: inline-block; margin-top: 2px; padding: 0 7px; border: 1px solid var(--line); border-radius: 10px;
  background: transparent; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; }
.bb-badge.bb-on { border-color: transparent; color: var(--ok); background: var(--ok-bg); }
.bb-badge.bb-on.bb-lost { color: var(--warn); background: var(--warn-bg); }
.bb-badge:hover { filter: brightness(.96); }
.bb-log { width: 100%; border-collapse: collapse; font-size: 12px; }
.bb-log th, .bb-log td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.toasts { position: fixed; top: 14px; right: 14px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: min(460px, calc(100vw - 28px)); }
.toasts .flash { margin: 0; box-shadow: 0 6px 20px rgba(0,0,0,.15); cursor: pointer; }
@keyframes blink-row { 25%, 75% { background-color: #ffe3c4; border-color: var(--brand); } }
.listing.blink, .master.blink { animation: blink-row 1.6s ease-in-out; }

/* Müşteri soruları */
.nav-count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 600; text-align: center; line-height: 18px; }
.qa { padding: 14px 16px; margin-bottom: 12px; }
.qa-wait { border-left: 3px solid var(--brand); }
.qa-head { display: flex; gap: 12px; align-items: center; }
.qa-img { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; background: #f3f4f6; flex-shrink: 0; }
.qa-product { flex: 1; min-width: 0; }
.qa-q, .qa-a { margin-top: 10px; }
.qa-q p, .qa-a p { margin: 2px 0 0; white-space: pre-line; }
.qa-q p { font-weight: 600; }
.qa-a { padding: 8px 12px; border-radius: 8px; background: #f8fafc; }
.qa-rej { background: var(--err-bg); color: var(--err); }
.qa-who { font-size: 12px; color: var(--muted); }
.qa-form { margin-top: 10px; }
.qa-form textarea { width: 100%; }
.qa-form .form-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sidebar nav a.on .nav-count { background: #fff; color: var(--brand-d); }

/* Gösterge paneli */
.stat small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.stat > span { display: block; }
.stat-warn b { color: var(--warn); }
.txt-ok { color: var(--ok); }
.txt-err { color: var(--err); }
.filters-inline { margin: 0; }
.chart-card { padding: 14px 16px; margin-bottom: 16px; }
.chart-head { margin-bottom: 6px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .grid.axis { stroke: #c9ced6; }
.chart .tick { font-size: 11px; fill: var(--muted); }
.chart .bar { fill: #f6a25c; }
.chart .bar-today { fill: var(--brand); }
.chart .hit { fill: transparent; }
.chart .bar-g:hover .bar { fill: var(--brand-d); }
.chart .bar-g:hover .hit { fill: rgba(0, 0, 0, .03); }
.chart-table { margin-top: 6px; font-size: 13px; }
.chart-table table { margin-top: 6px; }
.chart-tip { position: fixed; z-index: 60; pointer-events: none; padding: 6px 10px; border-radius: 6px; background: var(--side); color: #fff; font-size: 12px; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; margin-bottom: 12px; }
.dash-grid .card { padding: 14px 16px; }
.dash-grid h3 { margin: 0 0 10px; font-size: 15px; }
.todo { margin: 0; padding-left: 18px; }
.todo li { margin: 4px 0; }
table.compact { width: 100%; border-collapse: collapse; font-size: 13px; }
table.compact th, table.compact td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: left; }
table.compact .num { text-align: right; }
