:root {
  --bg: #f6f5f2; --panel: #ffffff; --ink: #1b1c1f; --muted: #6b6d74; --line: #e4e2dc; --soft: #efede8;
  --brand: #2f4a3a; --brand-ink: #fff; --accent: #b4532a; --ok: #2f7a4b; --warn: #a86a12; --bad: #b3261e;
  --r: 10px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141517; --panel: #1c1d20; --ink: #ecebe7; --muted: #9b9ca2; --line: #2d2e33; --soft: #232428;
    --brand: #8fbf9f; --brand-ink: #10120f; --accent: #e08a5f; --ok: #6fc28d; --warn: #e0a84a; --bad: #f08a80;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font: 500 30px/1.15 var(--serif); letter-spacing: -.01em; }
h2 { font: 500 23px/1.2 var(--serif); }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 14px; }
.stack-lg > * + * { margin-top: 28px; }

/* düğmeler ve alanlar */
button, .btn { font: inherit; font-weight: 500; cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 8px 14px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; line-height: 1.3; }
button:hover, .btn:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
button.primary, .btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--bad); }
button.link { border: 0; background: none; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
button:disabled { opacity: .5; cursor: default; }
input, textarea, select { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; }
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 0; border-color: var(--brand); }
textarea { min-height: 96px; resize: vertical; }
input[type="color"] { padding: 2px; width: 40px; height: 34px; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); }
label.field { display: block; }
label.field > span, .label { display: block; font-weight: 600; margin-bottom: 6px; }
.help { color: var(--muted); font-size: 13px; margin: -2px 0 8px; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; cursor: pointer; background: var(--panel); user-select: none; }
.pill input { display: none; }
.pill.on { background: color-mix(in srgb, var(--brand) 12%, var(--panel)); border-color: var(--brand); color: var(--ink); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.badge.musteride { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge.teslim { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.badge.yapim { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }
.badge.bitti { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 8px; z-index: 50; max-width: calc(100vw - 32px); }
.toast.err { background: var(--bad); color: #fff; }

/* giriş */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login .card { width: 100%; max-width: 380px; padding: 32px; }
.login h1 { margin-bottom: 6px; }
.brandmark { font: 500 15px var(--serif); letter-spacing: .02em; color: var(--muted); margin-bottom: 22px; }
.brandmark b { color: var(--ink); font-weight: 600; }
.error { color: var(--bad); font-size: 14px; }

/* uygulama çatısı */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .in { max-width: 1240px; margin: 0 auto; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.shell { max-width: 1240px; margin: 0 auto; padding: 28px 20px 80px; display: grid; grid-template-columns: 250px 1fr; gap: 36px; align-items: start; }
.steps { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; }
.steps button { border: 0; background: none; justify-content: flex-start; padding: 8px 10px; border-radius: 8px; color: var(--muted); text-align: left; width: 100%; }
.steps button:hover { background: var(--soft); }
.steps button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.steps .dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; display: grid; place-items: center; font-size: 11px; }
.steps .done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps .part .dot { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 25%, transparent); }
.progress { height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; margin: 10px 10px 16px; }
.progress i { display: block; height: 100%; background: var(--ok); transition: width .3s; }
.main { min-width: 0; }
.main > header { margin-bottom: 24px; }
.main > header p { margin-top: 6px; color: var(--muted); max-width: 62ch; }
.q { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.qs > * + * { margin-top: 12px; }
.save-state { font-size: 13px; color: var(--muted); }
.navbtns { display: flex; justify-content: space-between; margin-top: 28px; gap: 12px; }
.list-input .li { display: flex; gap: 8px; margin-bottom: 8px; }
.list-input .li button { flex: none; }

/* dosyalar */
.drop { border: 1.5px dashed var(--line); border-radius: var(--r); padding: 28px; text-align: center; color: var(--muted); cursor: pointer; background: var(--panel); }
.drop.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--panel)); }
.files { display: grid; gap: 8px; }
.file { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.file .thumb { width: 44px; height: 44px; border-radius: 6px; background: var(--soft) center/contain no-repeat; flex: none; display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.file .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-box { display: grid; place-items: center; height: 160px; background: repeating-conic-gradient(var(--soft) 0 25%, var(--panel) 0 50%) 0 0/20px 20px; border: 1px solid var(--line); border-radius: var(--r); }
.logo-box img { max-height: 120px; max-width: 80%; }
.bar { height: 4px; background: var(--soft); border-radius: 9px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--brand); width: 0; }

/* palet ve font */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.choice { background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--r); padding: 14px; cursor: pointer; text-align: left; display: block; width: 100%; }
.choice.on { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.swatches { display: flex; height: 54px; border-radius: 7px; overflow: hidden; margin-bottom: 12px; border: 1px solid var(--line); }
.swatches i { flex: 1; }
.swatches i:first-child { flex: 2; }
.fontsample .h { font-size: 26px; line-height: 1.15; margin-bottom: 8px; }
.fontsample .b { font-size: 14px; color: var(--muted); }
.preview-frame { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.preview-wrap { position: relative; }
.preview-wrap .open { position: absolute; top: 10px; right: 10px; }

/* modül öğeleri */
.items { display: grid; gap: 10px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.item > .hd { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; }
.item > .hd .t { flex: 1; min-width: 0; font-weight: 600; }
.item > .hd .t small { display: block; font-weight: 400; color: var(--muted); }
.item > .bd { border-top: 1px solid var(--line); padding: 16px; }
.cat { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }

/* yönetici */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); padding: 10px 12px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 20px 80px; }
table.list { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; background: var(--soft); }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: color-mix(in srgb, var(--soft) 60%, transparent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 6px 18px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.secret { font-family: ui-monospace, Menlo, monospace; background: var(--soft); padding: 14px; border-radius: 8px; white-space: pre-wrap; font-size: 13px; }
.pal-edit { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pal-edit label { font-size: 12px; color: var(--muted); }
.pal-edit .c { display: flex; gap: 6px; align-items: center; }
.pal-edit input[type="text"] { font-family: ui-monospace, Menlo, monospace; font-size: 12px; padding: 6px; }
.qrow { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.qrow:last-child { border-bottom: 0; }
.qrow .grow { flex: 1; min-width: 0; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal { background: var(--panel); border-radius: 12px; padding: 24px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; gap: 16px; padding-top: 12px; }
  .steps { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .steps button { width: auto; white-space: nowrap; }
  .progress { display: none; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv dd { margin-bottom: 10px; }
  .pal-edit { grid-template-columns: repeat(2, 1fr); }
  .preview-frame { height: 520px; }
  table.list .hide-sm { display: none; }
  h1 { font-size: 26px; }
}
