:root {
  --bg: #f3f5fa;
  --card: #ffffff;
  --ink: #1b2232;
  --muted: #5f6b80;
  --line: #e1e6ef;
  --soft: #eef2f9;
  --brand: #2459d6;
  --brand-ink: #ffffff;
  --brand-soft: #e7eefc;
  --danger: #d23b2a;
  --danger-soft: #fdecea;
  --ok: #138a5b;
  --ok-soft: #e4f6ee;
  --warn: #b7700a;
  --warn-soft: #fff4e0;
  --c-pdf: #d9452b;
  --c-img: #12935f;
  --c-office: #2b6fdc;
  --c-print: #7a4bd6;
  --c-phone: #e0820e;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 2px 8px rgba(20, 30, 60, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 "Segoe UI", Tahoma, Arial, sans-serif;
  min-height: 100vh;
}
a { color: var(--brand); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 18px; }
.logo svg { width: 30px; height: 30px; }
.top .spacer { flex: 1; }
.crumb { color: var(--muted); font-size: 15px; display: flex; align-items: center; gap: 8px; }
.crumb b { color: var(--ink); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer; font-weight: 600; white-space: nowrap;
  text-decoration: none; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--soft); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: #f3c5bf; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.big { padding: 14px 22px; font-size: 17px; border-radius: 11px; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--soft); }
.btn.phone-on { border-color: var(--c-phone); color: var(--c-phone); }

/* ---------- layout ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 22px 20px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } .side { position: static; } }

/* ---------- home ---------- */
.hero { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.hero h1 { font-size: 26px; }
.search { flex: 1; min-width: 240px; max-width: 420px; position: relative; }
.search input[type=text] { width: 100%; padding: 11px 14px 11px 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.cat { margin: 26px 0 10px; display: flex; align-items: center; gap: 10px; }
.cat h2 { font-size: 17px; }
.cat .dot { width: 10px; height: 10px; border-radius: 50%; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; }
.tile {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card);
  cursor: pointer; box-shadow: var(--shadow); transition: transform .1s, border-color .1s;
}
.tile:hover { border-color: var(--tc, var(--brand)); transform: translateY(-1px); }
.tile .ic { flex: none; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--tc-soft, var(--brand-soft)); color: var(--tc, var(--brand)); }
.tile .ic svg { width: 24px; height: 24px; }
.tile b { display: block; font-size: 15px; margin-bottom: 2px; }
.tile span { color: var(--muted); font-size: 13px; line-height: 1.35; }
.tile.feature { grid-column: span 2; background: linear-gradient(135deg, #f4efff, #ffffff); }
@media (max-width: 520px) { .tile.feature { grid-column: span 1; } }

.howto { margin-top: 30px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.howto .card { padding: 16px; }
.howto h3 { font-size: 15px; margin-bottom: 8px; }
.howto ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.howto li { margin: 3px 0; }

/* ---------- tool pages ---------- */
.tool-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.tool-head .ic { width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; }
.tool-head .ic svg { width: 26px; height: 26px; }
.tool-head h1 { font-size: 22px; }
.tool-head p { margin: 2px 0 0; color: var(--muted); }

.drop {
  border: 2px dashed #c3cde0; border-radius: var(--radius); background: var(--card);
  padding: 42px 20px; text-align: center; cursor: pointer; transition: border-color .12s, background .12s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop svg { width: 46px; height: 46px; color: var(--brand); }
.drop b { display: block; font-size: 18px; margin: 8px 0 4px; }
.drop.compact { padding: 16px; }
.drop.compact svg { width: 26px; height: 26px; }
.drop.compact b { font-size: 15px; margin: 4px 0 0; }

label.field { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 14px; }
label.field .muted { font-weight: 400; }
input[type=text], input[type=number], input[type=password], select, textarea {
  padding: 9px 11px; border: 1px solid #cfd6e3; border-radius: 8px; background: #fff; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
input[type=range] { width: 100%; accent-color: var(--brand); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--card); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 13px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--brand); color: #fff; }
.panel-title { font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.hr { height: 1px; background: var(--line); margin: 4px 0; }

.note { border-radius: 10px; padding: 11px 14px; background: var(--brand-soft); color: #1f3f8f; font-size: 14px; }
.note.warn { background: var(--warn-soft); color: #7a4a00; }
.note.ok { background: var(--ok-soft); color: #0d5c3c; }
.note.err { background: var(--danger-soft); color: #8d2216; }

/* ---------- page thumbnails ---------- */
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.pg {
  position: relative; background: var(--card); border: 2px solid transparent; border-radius: 10px;
  padding: 8px 8px 6px; cursor: pointer; box-shadow: var(--shadow); user-select: none;
}
.pg .th { height: 170px; display: grid; place-items: center; background: var(--soft); border-radius: 6px; overflow: hidden; }
.pg .th canvas, .pg .th img { max-width: 100%; max-height: 100%; box-shadow: 0 0 0 1px #d6dbe6; background: #fff; transition: transform .15s; }
.pg .num { text-align: center; font-size: 13px; font-weight: 600; margin-top: 5px; color: var(--muted); }
.pg .src { position: absolute; top: 12px; left: 12px; font-size: 11px; background: rgba(27,34,50,.75); color: #fff; padding: 1px 6px; border-radius: 5px; }
.pg.sel { border-color: var(--brand); background: var(--brand-soft); }
.pg.sel .num { color: var(--brand); }
.pg.del { opacity: .45; }
.pg.del .th::after { content: "SİLİNECEK"; position: absolute; top: 70px; left: 50%; transform: translateX(-50%) rotate(-12deg); background: var(--danger); color: #fff; font-weight: 700; font-size: 12px; padding: 3px 8px; border-radius: 4px; }
.pg .tools { position: absolute; top: 12px; right: 12px; display: none; gap: 4px; }
.pg:hover .tools { display: flex; }
.pg .tools button { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; }
.pg .tools button:hover { background: var(--soft); }
.pg .tools svg { width: 16px; height: 16px; }
.pg.ghost { opacity: .3; }
.pg.blank .th { background: #fff; border: 1px dashed #c3cde0; color: var(--muted); font-size: 13px; }

/* ---------- file list ---------- */
.flist { display: flex; flex-direction: column; gap: 8px; }
.fitem { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.fitem .handle { cursor: grab; color: var(--muted); }
.fitem .fi { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; flex: none; overflow: hidden; }
.fitem .fi img { width: 100%; height: 100%; object-fit: cover; }
.fitem .nm { flex: 1; min-width: 0; }
.fitem .nm b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fitem .nm span { font-size: 13px; color: var(--muted); }

/* ---------- result ---------- */
.result { border: 1px solid #bfe5d3; background: var(--ok-soft); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.result .title { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #0d5c3c; }
.result .title svg { width: 22px; height: 22px; }

/* ---------- overlay / toast ---------- */
.busy { position: fixed; inset: 0; background: rgba(243,245,250,.75); z-index: 100; display: grid; place-items: center; }
.busy .box { background: var(--card); border-radius: 14px; padding: 22px 28px; box-shadow: 0 10px 40px rgba(0,0,0,.15); display: flex; align-items: center; gap: 14px; font-weight: 600; max-width: 90vw; }
.spin { width: 26px; height: 26px; border: 3px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 110; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #1b2232; color: #fff; padding: 11px 18px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.2); font-weight: 500; max-width: 90vw; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

.modal-bg { position: fixed; inset: 0; background: rgba(15,20,35,.45); z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--card); border-radius: 14px; max-width: 560px; width: 100%; max-height: 90vh; overflow: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h2 { font-size: 19px; margin-bottom: 10px; }

/* ---------- duplex wizard ---------- */
.steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.steps .st { flex: 1; min-width: 120px; padding: 10px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.steps .st i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font-size: 13px; flex: none; }
.steps .st.on { border-color: var(--c-print); color: var(--ink); }
.steps .st.on i { background: var(--c-print); color: #fff; }
.steps .st.done i { background: var(--ok); color: #fff; }
.bigstep { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
@media (max-width: 800px) { .bigstep { grid-template-columns: 1fr; } }
.bigstep h2 { font-size: 24px; margin-bottom: 10px; }
.bigstep .lead { font-size: 17px; }
.bigstep ul.do { padding-left: 0; list-style: none; margin: 14px 0; display: flex; flex-direction: column; gap: 10px; }
.bigstep ul.do li { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; }
.bigstep ul.do li b.n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--c-print); color: #fff; display: grid; place-items: center; font-size: 14px; }
.illus { background: #faf8ff; border: 1px solid #e6defa; border-radius: 14px; padding: 12px; }
.illus svg { width: 100%; height: auto; display: block; }
.choice { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.choice button { text-align: left; padding: 12px; border-radius: 11px; border: 2px solid var(--line); background: var(--card); cursor: pointer; }
.choice button:hover { border-color: var(--c-print); }
.choice button svg { width: 100%; height: 110px; display: block; margin-bottom: 6px; }
.choice button b { display: block; }
.choice button span { font-size: 13px; color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

/* ---------- image editor ---------- */
.imgstage { background: #2a3040; border-radius: var(--radius); height: 62vh; min-height: 380px; overflow: hidden; }
.imgstage img { display: block; max-width: 100%; }
.thumbs-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; }
.thumbs-row img { height: 64px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; }
.thumbs-row img.on { border-color: var(--brand); }
.preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.preset-row button { padding: 8px 4px; font-size: 13px; }

/* ---------- id card / photo ---------- */
.sheet-preview { background: #fff; box-shadow: 0 0 0 1px var(--line), var(--shadow); margin: 0 auto; width: 100%; max-width: 420px; aspect-ratio: 210 / 297; position: relative; }
.sheet-preview canvas { width: 100%; height: 100%; display: block; }

/* ---------- phone panel ---------- */
.qrbox { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qrbox .qr { background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--line); }
.qrbox .qr img, .qrbox .qr canvas { display: block; width: 190px; height: 190px; image-rendering: pixelated; }
.code { font: 700 30px/1 Consolas, monospace; letter-spacing: .12em; color: var(--c-phone); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 380px; }
.login .logo { justify-content: center; margin-bottom: 18px; font-size: 22px; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.login input { padding: 12px; font-size: 17px; }
