:root {
  --bg: #f4f5f7;
  --card: #fff;
  --text: #1f2933;
  --muted: #6b7785;
  --line: #e2e6ea;
  --accent: #2b59c3;
  --accent-dark: #1f4299;
  --ok: #1d8a4e;
  --off: #a33;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 0 0 .4rem; }
.muted { color: var(--muted); }

.topbar { display: flex; align-items: center; gap: 1.5rem; padding: .7rem 1.5rem; background: #14213d; color: #fff; }
.topbar a { color: #dbe4ff; }
.brand { font-weight: 700; font-size: 1.15rem; color: #fff !important; }
.nav { display: flex; gap: 1.1rem; flex: 1; }
.userbox { display: flex; gap: .9rem; align-items: center; font-size: .9rem; }
.userbox .muted { color: #aab6d3; }

.container { max-width: 1000px; margin: 1.5rem auto; padding: 0 1rem; }
.container.narrow { max-width: 480px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; margin: 1rem 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin: 1rem 0; }
.grid .card { margin: 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .25rem; }
.field input[type=text], .field input[type=password], .field input[type=email],
.field input[type=url], .field input[type=file], .field textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid #c5cdd6; border-radius: 6px; font: inherit; background: #fff;
}
.field input:focus, .field textarea:focus { outline: 2px solid #b6c8f2; border-color: var(--accent); }
.errors { color: var(--off); font-size: .9rem; }
.errors ul { margin: .25rem 0 0; padding-left: 1.1rem; }

.btn { display: inline-block; padding: .55rem 1.1rem; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn.secondary { background: #e7ebf3; color: var(--text); }
.btn.secondary:hover { background: #d9dfeb; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.topbar button.link { color: #dbe4ff; }
button.link:hover { text-decoration: underline; }
form.inline { display: inline; margin: 0; }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.msg { padding: .65rem .9rem; border-radius: 6px; margin-bottom: .5rem; background: #e7efff; }
.msg.success { background: #dff3e7; }
.msg.error { background: #fbe4e4; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); }
th { font-size: .85rem; color: var(--muted); font-weight: 600; }
td.right { text-align: right; }

.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; background: #eef0f4; color: var(--muted); font-size: .78rem; font-weight: 600; }
.badge.ok { background: #dff3e7; color: var(--ok); }
.badge.off { background: #fbe4e4; color: var(--off); }
.logo-preview { max-height: 80px; max-width: 220px; }

/* --- Aşama 2: ürünler --- */
.container.medium { max-width: 760px; }
.actions { display: flex; gap: .5rem; align-items: center; }
.btn.danger { background: #b3261e; color: #fff; }
.btn.danger:hover { background: #8f1d17; }
.btn.secondary.danger { background: #fbe4e4; color: #8f1d17; }
.btn.secondary.danger:hover { background: #f5cfcf; }
.filters { display: flex; gap: .5rem; align-items: center; margin: 1rem 0; flex-wrap: wrap; }
.filters input[type=search] { flex: 1; min-width: 220px; }
.filters input, .filters select, .field select, .inline-form input[type=text] {
  padding: .55rem .7rem; border: 1px solid #c5cdd6; border-radius: 6px; font: inherit; background: #fff;
}
.field select { width: 100%; }
.field input[type=color] { width: 70px; height: 40px; padding: 2px; }
.thumb { width: 56px; }
.thumb img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.pager { display: flex; justify-content: center; gap: 1rem; align-items: center; margin: 1rem 0; }
.empty { text-align: center; padding: 2rem 1rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.three-col { display: grid; grid-template-columns: 2fr 1.4fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .two-col, .three-col { grid-template-columns: 1fr; } }
.detail-grid { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 1rem; align-items: start; }
@media (max-width: 760px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-image { max-width: 100%; border-radius: 8px; }
dl.facts { display: grid; grid-template-columns: 110px 1fr; gap: .3rem .75rem; margin: 0 0 1rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 600; }
.inline-form { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.inline-form .grow { flex: 1; margin: 0; min-width: 200px; }
.inline-form .grow input { width: 100%; }
label.check { display: inline-flex; gap: .4rem; align-items: center; font-weight: 400; }
.spec-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.spec-row input[type=text] { width: 100%; padding: .5rem .65rem; border: 1px solid #c5cdd6; border-radius: 6px; font: inherit; }
.spec-row .errors.full { grid-column: 1 / -1; }
.spec-row .del { font-size: .85rem; color: var(--muted); }
.remove-row { font-size: 1.1rem; color: var(--muted); padding: 0 .4rem; }
details.card summary { cursor: pointer; font-weight: 600; margin-bottom: .5rem; }
.tips { padding-left: 1.1rem; font-size: .9rem; }
.card h2 { margin-bottom: .5rem; }
table th { white-space: nowrap; }
td.right, th.right { text-align: right; }
.push-right { margin-left: auto; font-size: .9rem; }

/* --- Ürün formu: modüller, 12 kolon ızgara --- */
.container.wide { max-width: 980px; }
.module { padding: 1rem 1.25rem 1.25rem; }
.module.disabled { opacity: .6; background: #fafbfc; border-style: dashed; }
.module-title { display: flex; align-items: center; gap: .55rem; font-size: 1.05rem; margin: 0 0 .9rem; }
.module-title .step { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--accent); color: #fff; font-size: .8rem; font-weight: 700; }
.module.disabled .step { background: #9aa6b5; }
.subhead { font-weight: 600; margin: 1.1rem 0 .5rem; font-size: .92rem; }
.subhead .muted { font-weight: 400; font-size: .85rem; }
.hint { color: var(--muted); font-size: .82rem; margin: 0; }
p.hint { margin-top: .6rem; }

.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: .65rem .8rem; align-items: start; }
.form-grid > .field { margin: 0; min-width: 0; }
.form-grid .s2 { grid-column: span 2; } .form-grid .s3 { grid-column: span 3; } .form-grid .s4 { grid-column: span 4; }
.form-grid .s6 { grid-column: span 6; } .form-grid .s12 { grid-column: span 12; }
@media (max-width: 720px) { .form-grid > * { grid-column: span 12 !important; } .form-grid > .s6, .form-grid > .s3, .form-grid > .s4 { grid-column: span 12 !important; } }

/* kompakt girdiler */
.form-grid .field label, .pf-image label { font-size: .8rem; font-weight: 600; color: #4a5565; margin-bottom: .15rem; }
.form-grid input[type=text], .form-grid select, .form-grid textarea,
.spec-row input[type=text] {
  width: 100%; padding: .42rem .6rem; border: 1px solid #c5cdd6; border-radius: 6px; font: inherit; background: #fff;
}
.form-grid textarea { resize: vertical; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .spec-row input:focus { outline: 2px solid #b6c8f2; border-color: var(--accent); }
.tag { font-size: .68rem; font-weight: 700; padding: .05rem .4rem; border-radius: 999px; vertical-align: middle; }
.tag.private { background: #fff1d6; color: #8a5a00; }

/* görsel bölmesi */
.pf-info { display: grid; grid-template-columns: 190px 1fr; gap: 1.1rem; align-items: start; }
@media (max-width: 720px) { .pf-info { grid-template-columns: 1fr; } }
.pf-image { display: flex; flex-direction: column; gap: .45rem; }
.image-drop { width: 190px; height: 190px; border: 1px dashed #b4bfcc; border-radius: 10px; background: #f6f7f9; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.image-drop img { width: 100%; height: 100%; object-fit: contain; display: block; }
.image-drop img[hidden], .image-drop .placeholder[hidden] { display: none; }
.image-drop .placeholder { color: var(--muted); font-size: .85rem; }
.file-btn { position: relative; display: inline-block; text-align: center; padding: .42rem .7rem; border-radius: 6px; background: #e7ebf3; cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--text); width: 190px; }
.file-btn:hover { background: #d9dfeb; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
label.check.small { font-size: .82rem; font-weight: 400; }
.pf-image small { max-width: 190px; line-height: 1.3; }

/* ek özellik satırları: iki sütun, kompakt */
#spec-rows { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem .9rem; margin-bottom: .6rem; }
@media (max-width: 720px) { #spec-rows { grid-template-columns: 1fr; } }
.spec-row { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: .4rem; align-items: center; margin: 0; }
.btn.small { padding: .35rem .75rem; font-size: .85rem; }

/* yapışkan kaydet çubuğu */
.action-bar { position: sticky; bottom: 0; display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; margin: 1rem -1rem 0; background: rgba(244,245,247,.95); border-top: 1px solid var(--line); backdrop-filter: blur(3px); }
.action-bar .spacer { flex: 1; }

/* Görsel taşmasının düzeltilmesi (detay sayfası) */
.detail-grid > * { min-width: 0; }
.detail-image { display: block; width: 100%; height: auto; max-height: 420px; object-fit: contain; border-radius: 8px; background: #f6f7f9; }
.card img { max-width: 100%; }

/* kategori ağacı */
tr.sub td:first-child { padding-left: 2rem; color: #3b4654; }
tr.sub td:first-child::before { content: "└ "; color: var(--muted); }
tr.main td { font-weight: 600; background: #fafbfc; }
