:root {
  --bg: #14171c; --panel: #1c2128; --panel2: #232a33; --line: #2f3843; --text: #e3e8ee; --muted: #8b97a6;
  --accent: #3b9eff; --accent-2: #1f6fd0; --danger: #e5484d; --ok: #3fb950; --warn: #d29922;
  --radius: 8px; --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 12px; font-weight: 600; }
h1 { font-size: 22px; } h2 { font-size: 17px; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.hidden { display: none !important; }

input, select, button, textarea { font: inherit; color: inherit; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select {
  background: #11151a; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
label { display: block; font-size: 12.5px; color: var(--muted); margin: 12px 0 4px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 6px; padding: 7px 12px; cursor: pointer; white-space: nowrap; color: var(--text);
}
.btn:hover { background: #2b3440; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn.primary:hover { background: var(--accent); }
.btn.danger { color: #ff8a8e; }
.btn.danger:hover { background: #3a2023; }
.btn.small { padding: 4px 8px; font-size: 12.5px; }

/* üst çubuk */
.topbar { display: flex; align-items: center; gap: 14px; height: 50px; padding: 0 18px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 16px; color: var(--text); letter-spacing: .2px; }
.brand span { color: var(--accent); }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { padding: 6px 10px; border-radius: 6px; color: var(--muted); }
.topbar nav a.active, .topbar nav a:hover { color: var(--text); background: var(--panel2); text-decoration: none; }

.page { max-width: 1180px; margin: 0 auto; padding: 26px 18px 60px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* giriş */
.auth-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.auth { width: 100%; max-width: 380px; }
.auth .brand { font-size: 26px; display: block; text-align: center; margin-bottom: 6px; }
.auth p.lead { text-align: center; color: var(--muted); margin: 0 0 18px; }
.tabs { display: flex; gap: 4px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; cursor: pointer; color: var(--muted); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.auth .btn { width: 100%; justify-content: center; margin-top: 18px; padding: 10px; }
.note { background: #1b2a3d; border: 1px solid #2a4a70; border-radius: 6px; padding: 9px 11px; font-size: 13px; margin: 12px 0 0; }
.error { color: #ff8a8e; font-size: 13px; min-height: 18px; margin-top: 10px; }

/* tablo */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: #1f252d; }
.table-wrap { overflow-x: auto; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); }
.badge.admin { color: #7cc0ff; border-color: #2a4a70; background: #1b2a3d; }
.badge.blocked { color: #ff8a8e; border-color: #5a2a2d; background: #2c1a1c; }
.badge.ok { color: #7ee08a; border-color: #23502b; background: #16271a; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* çizim kartları */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 16px; }
.dcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.dcard:hover { border-color: #46566a; }
.dcard .name { font-weight: 600; font-size: 15px; color: var(--text); word-break: break-word; }
.dcard .meta { font-size: 12.5px; color: var(--muted); }
.empty { text-align: center; padding: 50px 10px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); margin-top: 16px; }

/* istatistik */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat .v { font-size: 26px; font-weight: 700; }
.stat .k { color: var(--muted); font-size: 12.5px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; margin-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; font-size: 11px; color: var(--muted); }
.bars .bar i { display: block; width: 100%; max-width: 46px; background: var(--accent-2); border-radius: 4px 4px 0 0; min-height: 2px; }

/* bildirim + pencere */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: 420px; }
.toast { background: #26303b; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; padding: 9px 12px; box-shadow: 0 6px 20px #0008; }
.toast.error { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }
.modal-bg { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; z-index: 90; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; width: 100%; max-width: 400px; }
.modal .row { justify-content: flex-end; margin-top: 16px; }

/* ---------- editör ---------- */
body.editor { display: flex; flex-direction: column; overflow: hidden; height: 100vh; }
.ed-top { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 10px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none; }
.ed-top input.docname { width: 230px; padding: 5px 8px; }
.ed-top .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.ed-main { flex: 1; display: flex; min-height: 0; }
.toolbar { display: flex; align-items: stretch; gap: 2px; padding: 4px 8px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none; flex-wrap: wrap; white-space: nowrap; }
.toolbar .tsep { width: 1px; background: var(--line); margin: 3px 4px; flex: none; }
.tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 50px; background: none; border: 1px solid transparent; border-radius: 5px; padding: 5px 6px 4px; cursor: pointer; font-size: 11.5px; flex: none; }
.tool:hover { background: var(--panel2); }
.tool.active { background: #1b2a3d; border-color: var(--accent-2); color: #cfe6ff; }
.tool svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.text-edit { position: absolute; z-index: 5; min-width: 220px; background: #0d1117ee; color: #fff; border: 1px solid var(--accent); border-radius: 3px; padding: 2px 6px; outline: none; font-family: "Segoe UI", Arial, sans-serif; }
.text-hint { position: absolute; z-index: 5; background: #000c; color: #cfe6ff; font-size: 12px; padding: 2px 8px; border-radius: 3px; pointer-events: none; }
.array-panel { position: absolute; z-index: 6; top: 12px; left: 12px; width: 300px; background: #1c2128f2; border: 1px solid var(--accent-2); border-radius: 8px; padding: 12px 14px; box-shadow: 0 8px 28px #000a; }
.array-panel h4 { margin: 0 0 8px; font-size: 14px; }
.array-panel label { margin: 8px 0 3px; }
.array-panel label input, .array-panel label select { margin-top: 3px; padding: 5px 8px; }
.array-panel .ap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.array-panel .ap-check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; margin-top: 10px; }
.array-panel .ap-check input { width: auto; margin: 0; }
.array-panel .ap-total { margin-top: 10px; font-size: 12px; color: #7ee08a; }
.array-panel .row { justify-content: flex-end; margin-top: 10px; }
#opts { display: inline-flex; gap: 4px; }
#opts button { background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 2px 9px; cursor: pointer; font: 12px var(--font); color: var(--text); }
#opts button:hover { background: #2b3440; }
#opts button.on { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.fbar { display: flex; align-items: center; gap: 6px; padding: 5px 10px 7px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); overflow-x: auto; white-space: nowrap; }
.fkey { display: inline-flex; align-items: center; gap: 7px; background: #171b21; border: 1px solid var(--line); border-radius: 5px; padding: 4px 10px; cursor: pointer; color: var(--muted); font-size: 12px; flex: none; }
.fkey b { background: #2b3440; color: var(--text); border-radius: 3px; padding: 0 5px; font: 600 11px Consolas, monospace; }
.fkey i { font-style: normal; font-weight: 700; font-size: 11px; color: #6b7684; }
.fkey.on { background: #12335a; border-color: var(--accent); color: #fff; }
.fkey.on b { background: var(--accent); color: #fff; }
.fkey.on i { color: #7ee08a; }
.fbar #coords { font: 12px Consolas, monospace; min-width: 170px; text-align: right; color: var(--text); }
.stage { flex: 1; position: relative; min-width: 0; background: #1a1d22; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#ov { cursor: crosshair; }
.drop-hint { position: absolute; inset: 12px; border: 2px dashed var(--accent); border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: #14171ccc; pointer-events: none; }
.side { width: 250px; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; flex: none; min-height: 0; }
.side section { padding: 10px; border-bottom: 1px solid var(--line); }
.side section.layers { flex: 1; min-height: 120px; display: flex; flex-direction: column; }
.side h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; }
#layerList { overflow-y: auto; flex: 1; margin: 0 -4px; }
.layer { display: flex; align-items: center; gap: 5px; padding: 3px 4px; border-radius: 4px; }
.layer.current { background: #1b2a3d; }
.layer input[type=text] { padding: 2px 4px; border-color: transparent; background: none; font-size: 12.5px; }
.layer input[type=text]:focus { border-color: var(--accent); background: #11151a; }
.layer input[type=color], .props input[type=color] { width: 20px; height: 20px; padding: 0; border: 1px solid var(--line); border-radius: 3px; background: none; flex: none; cursor: pointer; }
.layer .ic { background: none; border: 0; padding: 0 2px; cursor: pointer; font-size: 13px; width: 20px; color: var(--text); flex: none; }
.layer .ic.off { color: #56616e; }
.props .prow { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12.5px; }
.props .prow > span:first-child { width: 68px; color: var(--muted); flex: none; }
.props select, .props input[type=text], .props input[type=number] { padding: 3px 6px; font-size: 12.5px; }
.ed-bottom { flex: none; background: var(--panel); border-top: 1px solid var(--line); }
#cmdlog { height: 40px; overflow: hidden; padding: 3px 10px 0; font: 12px/1.5 Consolas, "Cascadia Mono", monospace; color: var(--muted); display: flex; flex-direction: column; justify-content: flex-end; }
.cmdline { display: flex; align-items: center; gap: 8px; padding: 4px 10px 6px; font: 13px Consolas, "Cascadia Mono", monospace; }
.cmdline #prompt { color: #9bd; white-space: nowrap; }
.cmdline input { flex: 1; background: #11151a; border: 1px solid var(--line); border-radius: 4px; padding: 4px 8px; font: inherit; outline: none; }
@media (max-width: 900px) { .side { display: none; } .ed-top input.docname { width: 130px; } }

/* ---------- herkese açık sayfalar (tanıtım, içerik) ---------- */
body.public { display: flex; flex-direction: column; min-height: 100vh; }
body.public .topbar { flex-wrap: wrap; height: auto; min-height: 50px; padding: 6px 18px; }
.land, .page-body { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 14px 18px 40px; }
.hero { text-align: center; padding: 22px 10px 18px; }
.hero h1 { font-size: 24px; line-height: 1.25; margin-bottom: 8px; }
.hero p { color: var(--muted); font-size: 14px; max-width: 600px; margin: 0 auto 16px; }
.btn.big { padding: 8px 18px; font-size: 14px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 18px 0; }
.features .card { padding: 12px 14px; }
.features h2 { font-size: 14px; margin-bottom: 4px; }
.features p { margin: 0; font-size: 12.5px; }
.page-body { max-width: 820px; }
.page-body h1 { font-size: 22px; margin-bottom: 12px; }
.page-body article { font-size: 14.5px; line-height: 1.6; }
.page-body article h2 { margin-top: 26px; }
.page-body article img { max-width: 100%; height: auto; }
/* reklam: banner boyutunda (en fazla 728 × 90), büyük görseller orantılı küçültülür */
.ad-slot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; margin: 10px 0; }
.ad-slot .ad { max-width: 100%; }
.ad-slot img { display: block; max-width: min(728px, 100%); max-height: 90px; width: auto; height: auto; object-fit: contain; border-radius: 4px; }
.ad-slot.top { margin: 8px 0 0; }
.site-footer { border-top: 1px solid var(--line); padding: 18px; display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: space-between; font-size: 13px; }
.site-footer a { margin-right: 16px; color: var(--muted); }
textarea { background: #11151a; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; outline: none; font: inherit; color: inherit; resize: vertical; }
textarea:focus { border-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } .hero h1 { font-size: 26px; } }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; margin-top: 14px; }
.check input { width: auto; margin: 0; }

/* paketler ve kota */
.quota { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; padding: 9px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; }
.quota:empty { display: none; }
.warn { color: #f0c870; }
.meter { height: 8px; background: #11151a; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; margin: 4px 0 10px; }
.meter i { display: block; height: 100%; background: var(--accent); }
.meter i.full { background: var(--danger); }
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 12px; }
.pkg { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.pkg.current { border-color: var(--accent-2); box-shadow: 0 0 0 1px var(--accent-2) inset; }
.pkg h2 { margin: 0; font-size: 17px; }
.pkg .price { font-size: 24px; font-weight: 700; }
.pkg .price small { font-size: 13px; font-weight: 400; color: var(--muted); }
.pkg ul { list-style: none; margin: 0; padding: 0; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.pkg li.no { color: var(--muted); text-decoration: line-through; }
.pkg .spacer { flex: 1; }
.payinfo { white-space: pre-wrap; background: #11151a; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font-size: 13.5px; }
.badge.warn { color: #f0c870; border-color: #5c4a1c; background: #2d2614; }
/* yazdırma penceresi */
.print-modal { max-width: none; width: min(1180px, 96vw); height: min(760px, 92vh); display: flex; gap: 16px; padding: 16px; }
.print-side { width: 300px; flex: none; overflow-y: auto; }
.print-side h2 { margin-bottom: 4px; }
.print-side label { margin: 10px 0 4px; }
.print-row { display: flex; gap: 8px; align-items: flex-end; }
.print-row > * { flex: 1; }
.print-info { font-size: 12.5px; margin-top: 6px; min-height: 18px; }
.print-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.print-preview { flex: 1; min-width: 0; background: #2a2f36; border-radius: 6px; display: grid; place-items: center; overflow: hidden; }
.print-preview canvas { background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.5); }
@media (max-width: 800px) { .print-modal { flex-direction: column; height: auto; } .print-side { width: auto; } .print-preview { height: 50vh; } }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 12px; }

/* editör: kurumsal simge */
.ed-top .brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-ic { width: 24px; height: 24px; display: block; flex: none; }
