:root {
  --ink: #1f2a33;
  --ink-2: #4a5864;
  --muted: #56616c; /* erişilebilirlik: beyaz ve zemin üzerinde ≥4,5 karşıtlık */
  --accent: #b8733a;
  --accent-2: #9a5d2c;
  --accent-soft: #f6ebe0;
  --bg: #f4f2ee;
  --surface: #ffffff;
  --border: #e3dfd8;
  --ok: #2e7d4f;
}
body { background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--accent-2); }
.main-wrap { min-height: 70vh; }
@media (max-width: 991.98px) { .main-wrap { padding-bottom: 90px !important; } }

/* Üst bar */
.topbar { background: var(--ink); }
.topbar .nav-link, .topbar .btn-link { color: #d7dde2; }
.topbar .nav-link:hover, .topbar .nav-link.active { color: #fff; }
.topbar .nav-link.active { box-shadow: inset 0 -2px 0 var(--accent); }
.topbar .navbar-toggler { color: #fff; }
.topbar .navbar-collapse { padding-bottom: .5rem; }
.brand { color: #fff !important; font-weight: 400; letter-spacing: .3px; display: flex; align-items: center; gap: .5rem; }
.brand b { color: #e9c9a3; font-weight: 700; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; font-weight: 800; }
.btn-icon { color: #fff; font-size: 1.25rem; padding: .25rem .5rem; }
.notif-dot { position: absolute; top: 0; right: 0; font-size: .6rem; }
.nav-admin { color: #f3c58f !important; }

.btn-accent { background: var(--accent-2); border-color: var(--accent-2); color: #fff; } /* beyaz yazıyla ≥4,5 karşıtlık */
.btn-accent:hover, .btn-accent:focus { background: #7f4c22; border-color: #7f4c22; color: #fff; }
.btn-outline-accent { border-color: var(--accent); color: var(--accent-2); }
.btn-outline-accent:hover { background: var(--accent); color: #fff; }
.text-accent { color: var(--accent-2) !important; }

/* Kartlar */
.card-soft { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.4rem; margin: 0; font-weight: 700; }

/* Ana sayfa kahraman bölümü */
.hero { background: linear-gradient(135deg, #26333d 0%, #3a4954 60%, #6b5543 100%); color: #fff; border-radius: 18px; padding: 1.5rem; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255,255,255,.035) 0 2px, transparent 2px 22px); pointer-events: none; }
.hero h1 { font-size: 1.6rem; font-weight: 800; }
.hero p { color: #d9dfe4; }
.hero .search-box { background: var(--surface); color: var(--ink); border-radius: 14px; padding: 1rem; position: relative; z-index: 1; }
@media (min-width: 992px) { .hero { padding: 2.5rem; } .hero h1 { font-size: 2.2rem; } }
.stat-pill { display: inline-flex; gap: .4rem; align-items: center; background: rgba(255,255,255,.12); border-radius: 999px; padding: .25rem .75rem; font-size: .85rem; }

.steps .step { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1rem; height: 100%; }
.steps .step i { font-size: 1.6rem; color: var(--accent); }

/* İlan kartı */
.item-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; height: 100%; display: flex; flex-direction: column; color: inherit; text-decoration: none; transition: transform .12s, box-shadow .12s; }
.item-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(31,42,51,.08); color: inherit; }
.item-photo { aspect-ratio: 4/3; background: #e9e5df center/cover no-repeat; display: grid; place-items: center; color: #b3aca2; font-size: 2rem; position: relative; }
.item-photo .tag { position: absolute; top: .5rem; left: .5rem; font-size: .72rem; }
.item-photo .badge { font-size: .72rem; }
.item-body { padding: .75rem .85rem; display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.item-title { font-weight: 700; font-size: 1rem; }
.dims { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.price { font-weight: 800; color: var(--accent-2); font-size: 1.1rem; }
.meta { color: var(--muted); font-size: .85rem; }
.waste { font-size: .75rem; }

/* Ölçü çizimi */
.dim-box { border: 2px solid var(--accent); background: var(--accent-soft); border-radius: 4px; position: relative; margin: 1.5rem auto; max-width: 100%; }
.dim-box .w-label, .dim-box .l-label { position: absolute; font-size: .8rem; font-weight: 700; color: var(--accent-2); }
.dim-box .w-label { top: -1.4rem; left: 50%; transform: translateX(-50%); }
.dim-box .l-label { left: -.4rem; top: 50%; transform: translate(-100%, -50%); }

.gallery-main { aspect-ratio: 4/3; width: 100%; object-fit: cover; border-radius: 14px; background: #e9e5df; }
.thumbs img { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.thumbs img.active { border-color: var(--accent); }

/* Tablolar / liste */
.table-clean { background: var(--surface); }
.table-clean th { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.stock-row { display: flex; gap: .75rem; align-items: center; padding: .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: .5rem; color: inherit; text-decoration: none; }
.stock-row:hover { border-color: var(--accent); color: inherit; }
.stock-thumb { width: 64px; height: 52px; border-radius: 8px; background: #e9e5df center/cover no-repeat; flex-shrink: 0; display: grid; place-items: center; color: #b3aca2; }
.stock-row .grow { flex: 1; min-width: 0; }
.qty-badge { font-weight: 800; font-size: 1.1rem; min-width: 3rem; text-align: right; }

.sum-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .75rem 1rem; }
.sum-tile .v { font-size: 1.4rem; font-weight: 800; }
.sum-tile .l { font-size: .8rem; color: var(--muted); }

.chip-filter { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .25rem; }
.chip-filter a { white-space: nowrap; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: .3rem .8rem; font-size: .85rem; color: var(--ink-2); text-decoration: none; }
.chip-filter a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state > i { font-size: 2.6rem; color: #c9c2b8; }

.photo-previews { display: flex; flex-wrap: wrap; gap: .5rem; }
.photo-previews img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; }

.form-label { font-weight: 600; font-size: .9rem; }
.form-section-title { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 1rem 0 .5rem; }
.seg { display: flex; flex-wrap: wrap; gap: .4rem; }
.seg input { display: none; }
.seg label { border: 1px solid var(--border); background: var(--surface); padding: .45rem .9rem; border-radius: 10px; cursor: pointer; font-weight: 600; }
.seg input:checked + label { background: var(--ink); color: #fff; border-color: var(--ink); }

.site-footer { padding: 1.5rem 0 2rem; border-top: 1px solid var(--border); margin-top: 2rem; }

/* Telefon alt menüsü */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030; background: var(--surface); border-top: 1px solid var(--border); display: flex; justify-content: space-around; align-items: center; padding: .35rem 0 calc(.35rem + env(safe-area-inset-bottom)); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; font-size: .7rem; color: var(--muted); text-decoration: none; gap: .1rem; }
.bottom-nav a i { font-size: 1.3rem; }
.bottom-nav a.active { color: var(--accent-2); }
.bottom-nav a.add { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; justify-content: center; margin-top: -24px; box-shadow: 0 6px 16px rgba(184,115,58,.4); }
.bottom-nav a.add i { font-size: 1.6rem; }

.status-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .25rem; }
.kv { display: grid; grid-template-columns: 9rem 1fr; gap: .35rem .75rem; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; font-weight: 600; }
@media (max-width: 575.98px) { .kv { grid-template-columns: 7.5rem 1fr; } }
.notif-unread { border-left: 3px solid var(--accent) !important; background: var(--accent-soft); }

/* ---- Filtreler (pazar / stok) ---- */
.filter-chip { display: inline-flex; align-items: center; gap: .2rem; background: var(--accent-soft); color: var(--accent-2); border-radius: 999px; padding: .2rem .7rem; font-size: .82rem; font-weight: 600; text-decoration: none; }
.filter-chip:hover { background: var(--accent); color: #fff; }
.seg-sm label { padding: .3rem .7rem; font-size: .85rem; }
.top-fields { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.top-fields > input[type=search] { flex: 1 1 100%; }
.top-fields.stack { flex-direction: column; align-items: stretch; }
.minsize { display: flex; align-items: center; gap: .3rem; }
.minsize input { width: 4.5rem; }
.cascade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.cascade-fld { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.cascade-fld label { font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: .35rem; }
.cascade-fld .step { width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent-2); display: inline-grid; place-items: center; font-size: .65rem; }
.cascade-fld select { min-width: 0; }
.cascade-fld select:disabled { opacity: .45; }
.facet-panel { padding: .25rem .9rem .5rem; position: sticky; top: .75rem; max-height: calc(100vh - 1.5rem); overflow-y: auto; }
.facet-top { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.facet { padding: .65rem 0; border-bottom: 1px solid var(--border); }
.facet:last-child { border-bottom: 0; }
.facet-h { display: flex; justify-content: space-between; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .3rem; }
.facet-n { color: var(--accent-2); text-transform: none; letter-spacing: 0; }
.facet-list.scroll { max-height: 13rem; overflow-y: auto; padding-right: .25rem; }
.facet-opt { display: flex; align-items: center; gap: .5rem; padding: .18rem 0; font-size: .9rem; cursor: pointer; }
.facet-opt .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.facet-opt .cnt { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.facet-opt.zero { opacity: .4; }
.facet-opt input { margin: 0; flex-shrink: 0; }

/* ---- Stok: hızlı işlemler / teyit ---- */
.verify-bar { background: #fff3cd; color: #664d03; border-bottom: 1px solid #ffe69c; padding: .5rem 0; font-size: .9rem; }
.stock-row-x { flex-direction: column; align-items: stretch; gap: .5rem; padding: .6rem .75rem; }
.stock-row-x .stock-link { display: flex; gap: .75rem; align-items: center; color: inherit; text-decoration: none; min-width: 0; }
.stock-row-x .stock-link .grow { flex: 1; min-width: 0; }
.row-actions { display: flex; gap: .4rem; flex-wrap: wrap; padding-left: calc(64px + .75rem); }
.row-actions form { margin: 0; }
@media (max-width: 575.98px) { .row-actions { padding-left: 0; } .row-actions .btn { flex: 1; } .row-actions form { flex: 1; display: flex; } .row-actions form .btn { width: 100%; } }
.age-ok { color: var(--ok); } .age-warn { color: #b26b00; } .age-bad { color: #b02a37; }
.cut-row { border: 1px dashed var(--border); border-radius: 12px; padding: .6rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .75rem 1rem; height: 100%; }
.kpi .v { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: .8rem; color: var(--muted); }
.bar { height: .5rem; border-radius: 99px; background: var(--accent-soft); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }

/* Kütüphane formu: ölçü × kalınlık tablosu */
.fmt-matrix { width: auto; min-width: 100%; }
.fmt-matrix th, .fmt-matrix td { vertical-align: middle; white-space: nowrap; }
.fmt-matrix thead th { font-size: .8rem; font-weight: 600; }
.fmt-matrix .fmt-size { cursor: pointer; user-select: none; }
.fmt-matrix .form-check-input { width: 1.35em; height: 1.35em; margin: 0; }
.fmt-add .input-group { width: auto; flex: 1 1 200px; max-width: 280px; }

/* Stoğum: hızlı süzgeçler, satış işaretleri, fiyat satırı, toplu işlem */
.quick-filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.qf { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .75rem; border-radius: 999px; font-size: .85rem; font-weight: 600; text-decoration: none; border: 1px solid var(--border); background: var(--surface); color: var(--ink); }
.qf b { font-weight: 800; }
.qf-arayan { border-color: #8fd19e; color: #146c2e; }
.qf-fiyatsiz { border-color: #f1aeb5; color: #b02a37; }
.qf-bekleyen { border-color: #ffda6a; color: #997404; }
.qf.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.row-flags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .25rem; }
.flag { font-size: .75rem; font-weight: 600; border-radius: 6px; padding: .05rem .45rem; }
.flag-hot { background: #d1e7dd; color: #0f5132; }
.flag-idle { background: #fff3cd; color: #664d03; }
.row-price { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0; padding-left: calc(64px + .75rem); }
.row-price input[name=price] { width: 9rem; flex: 1 1 7rem; max-width: 12rem; }
.min-w-0 { min-width: 0; }
.bulk-pick { display: none; align-items: center; padding: .25rem; margin: 0; cursor: pointer; }
.bulk-pick .form-check-input { width: 1.4em; height: 1.4em; margin: 0; }
.bulk-on .bulk-pick { display: flex; }
.bulk-on .row-price, .bulk-on .row-actions { padding-left: calc(64px + .75rem + 2.2rem); }
.bulk-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040; background: var(--surface); border-top: 2px solid var(--accent); box-shadow: 0 -6px 18px rgba(0,0,0,.12); padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom)); }
.bulk-on .main-wrap { padding-bottom: 11rem !important; }
@media (max-width: 575.98px) {
  .sum-row .sum-tile { padding: .45rem .5rem; text-align: center; }
  .sum-row .sum-tile .v { font-size: 1.1rem; }
  .sum-row .sum-tile .l { font-size: .7rem; }
  .stock-head .head-actions { width: 100%; }
  .stock-head .head-actions .btn { flex: 1; padding: .3rem .4rem; font-size: .8rem; }
  .row-price, .bulk-on .row-price, .bulk-on .row-actions { padding-left: 0; }
  .stock-row-x .stock-thumb { width: 52px; height: 44px; }
  .row-actions .btn { padding: .2rem .4rem; font-size: .8rem; }
}
.wanted-box { border-color: #8fd19e; background: #f3fbf5; }
.opp { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: .9rem; border: 1px solid var(--border); }
.opp > i:first-child { font-size: 1.2rem; }
.opp-hot { background: #f3fbf5; border-color: #8fd19e; } .opp-hot > i:first-child { color: #146c2e; }
.opp-price { background: #fdf3f4; border-color: #f1aeb5; } .opp-price > i:first-child { color: #b02a37; }
.opp-idle { background: #fffaeb; border-color: #ffda6a; } .opp-idle > i:first-child { color: #997404; }
.opp:hover { color: var(--ink); filter: brightness(.97); }
.more-list summary { cursor: pointer; color: var(--accent-2); list-style: none; }
.more-list[open] summary { display: none; }
.move-card { display: flex; gap: .6rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.move-card:last-child { border-bottom: 0; }
.move-chg { font-weight: 800; font-size: 1.05rem; min-width: 2.2rem; text-align: center; }
.row-cta { display: flex; gap: .4rem; padding-left: calc(64px + .75rem); }
.row-cta:empty { display: none; }
.row-cta form { margin: 0; }
.bulk-on .row-cta { padding-left: calc(64px + .75rem + 2.2rem); }
@media (max-width: 575.98px) { .row-cta, .bulk-on .row-cta { padding-left: 0; } .row-cta > *, .row-cta form .btn { width: 100%; } .row-cta form { flex: 1; } }
.cascade-fold summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--accent-2); list-style: none; padding: .25rem 0; }
.cascade-fold summary::-webkit-details-marker { display: none; }
.cascade-fold[open] summary { margin-bottom: .25rem; }
/* Görünürlük seçimi (3 seçenek) */
.vis-choice { display: grid; gap: .4rem; }
@media (min-width: 768px) { .vis-choice { grid-template-columns: repeat(3, 1fr); } }
.vis-choice input { position: absolute; opacity: 0; pointer-events: none; }
.vis-choice label { display: block; border: 1.5px solid var(--border); border-radius: 10px; padding: .55rem .7rem; cursor: pointer; background: var(--surface); }
.vis-choice input:checked + label { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.vis-choice input:focus-visible + label { outline: 2px solid var(--accent-2); }
/* Pazar: bölge seçimi */
.region-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.region-bar .seg a { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .8rem; border: 1px solid var(--border); background: var(--surface); color: var(--ink); text-decoration: none; font-size: .85rem; font-weight: 600; }
.region-bar .seg a:first-child { border-radius: 999px 0 0 999px; }
.region-bar .seg a:last-child { border-radius: 0 999px 999px 0; margin-left: -1px; }
.region-bar .seg a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
/* Alıcı teklif dökümü */
.offer-box { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .75rem; background: var(--bg); }
.offer-box.offer-open { border-color: var(--accent); background: var(--accent-soft); }
.offer-line { display: flex; justify-content: space-between; gap: .5rem; font-size: .88rem; padding: .1rem 0; }
.offer-total { border-top: 1px solid var(--border); margin-top: .2rem; padding-top: .3rem; font-size: .95rem; }

/* Erişilebilirlik: telefonda parmakla rahat basılacak dokunma alanları (en az ~40 px) */
@media (max-width: 991.98px) {
  .row-actions .btn, .row-cta .btn, .row-price .btn, .row-price .form-control, .row-price .form-select { min-height: 40px; }
  .seg-sm label, .region-bar .seg a, .filter-chip, .qf { min-height: 38px; display: inline-flex; align-items: center; }
  .seg label { min-height: 40px; display: inline-flex; align-items: center; }
  .form-control-sm, .form-select-sm { min-height: 38px; }
}
@media (max-width: 575.98px) { .row-actions .btn { font-size: .85rem; } }
/* Fotoğraf seç / çek düğmesi (asıl dosya kutusu gizli) */
.photo-pick { position: relative; }
.photo-pick input[type=file] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.photo-btn { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 52px; border: 2px dashed var(--accent); border-radius: 12px; background: var(--accent-soft); color: var(--accent-2); font-weight: 700; }
.photo-pick input[type=file]:focus-visible + .photo-btn { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.photo-btn .bi { font-size: 1.3rem; }
.photo-pick.has-files .photo-btn { border-style: solid; }
@media (max-width: 575.98px) { .stock-head .head-actions .btn { min-height: 40px; } }
.btn-outline-success { --bs-btn-color: #146c43; --bs-btn-border-color: #146c43; }
.row-actions .btn, .row-cta .btn, .stock-head .head-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: .25rem; }
/* Çalışan yetkileri */
.perm-list { display: grid; gap: .35rem; }
.perm-row { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--surface); }
.perm-row .form-check-input { width: 1.3em; height: 1.3em; margin-top: .15rem; flex-shrink: 0; }
.perm-row:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.unit { font-size: .6em; font-weight: 600; margin-left: .15em; color: var(--muted); }
