/* Yönetim paneli stilleri — mobil uyumlu */
:root { --p: #2563eb; --pd: #1d4ed8; --dark: #0b1b3a; --bg: #f3f6f8; --card: #fff; --line: #e2e8ee; --text: #3c4a55; --muted: #7b8a96; --red: #e5484d; --r: 12px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); }
a { color: var(--pd); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--dark); margin: 0; line-height: 1.3; }
.icon { width: 20px; height: 20px; flex-shrink: 0; }
.muted { color: var(--muted); }
.mt { margin-top: 14px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
kbd { font-size: 11px; opacity: .7; background: rgba(255,255,255,.2); padding: 1px 5px; border-radius: 4px; margin-left: 4px; font-family: inherit; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 9px 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; transition: background .2s, border-color .2s; white-space: nowrap; }
.btn--primary { background: var(--p); color: #fff; }
.btn--primary:hover { background: var(--pd); }
.btn--primary:disabled { opacity: .6; cursor: wait; }
.btn--light { background: #fff; border-color: var(--line); color: var(--dark); }
.btn--light:hover { border-color: var(--p); color: var(--pd); }
.btn--danger { background: #fff; border-color: #f3c3c4; color: var(--red); }
.btn--danger:hover { background: var(--red); color: #fff; }
.btn--dashed { width: 100%; border: 2px dashed var(--line); background: transparent; color: var(--pd); margin-top: 10px; }
.btn--dashed:hover { border-color: var(--p); background: #eef4ff; }
.btn--sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn--block { width: 100%; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: inline-grid; place-items: center; cursor: pointer; color: var(--text); font-size: 15px; padding: 0; }
.icon-btn:hover { border-color: var(--p); color: var(--pd); }
.icon-btn--danger:hover { border-color: var(--red); color: var(--red); }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; border: 1px solid; }
.alert--ok { background: #eafaf1; border-color: #b8ebcd; color: #17734a; }
.alert--err { background: #fdeeee; border-color: #f6c5c5; color: #b42318; }
.alert--warn { background: #fff8e6; border-color: #f7dc9b; color: #8a5a00; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .3px; flex-shrink: 0; }
.tag--green { background: #e8f1ff; color: #16794b; }
.tag--blue { background: #e6f0fd; color: #1d5fbf; }
.tag--gray { background: #eef1f4; color: var(--muted); }
.badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; min-width: 20px; height: 20px; border-radius: 10px; display: inline-grid; place-items: center; padding: 0 6px; }

/* Giriş */
.login-page { background: linear-gradient(135deg, var(--dark), #1d3a8a); min-height: 100vh; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login__card { width: 100%; max-width: 380px; background: #fff; border-radius: 18px; padding: 32px 26px; box-shadow: 0 30px 60px rgba(0,0,0,.25); display: grid; gap: 16px; }
.login__logo { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--dark); font-size: 18px; }
.login__logo span { width: 40px; height: 40px; border-radius: 12px; background: var(--p); color: #fff; display: grid; place-items: center; }
.login h1 { font-size: 22px; }
.login label, .stack label, .msg__form label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; color: var(--dark); }
.login__back { text-align: center; font-size: 14px; color: var(--muted); }
input, select, textarea { font: inherit; font-size: 15px; color: var(--dark); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 42px; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus, .rte__area:focus { outline: 0; border-color: var(--p); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
textarea { resize: vertical; }
select:disabled { background: #f7f9fa; color: var(--dark); opacity: 1; font-weight: 600; }

/* Yerleşim */
.app { display: flex; min-height: 100vh; }
.side { position: fixed; top: 0; left: 0; bottom: 0; width: 260px; background: var(--dark); color: rgba(255,255,255,.75); z-index: 50; overflow-y: auto; transform: translateX(-100%); transition: transform .3s; }
.side-open .side { transform: none; }
.side-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
.side-open .side-backdrop { display: block; }
.side__head { padding: 18px 18px 10px; }
.side__logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 16px; text-decoration: none !important; }
.side__logo span { width: 36px; height: 36px; border-radius: 10px; background: var(--p); display: grid; place-items: center; }
.side__nav { padding: 6px 10px 30px; display: grid; gap: 2px; }
.side__nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: rgba(255,255,255,.75); font-size: 14px; text-decoration: none !important; }
.side__nav a .icon { width: 18px; height: 18px; opacity: .8; }
.side__nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side__nav a.is-active { background: var(--p); color: #fff; }
.side__group { margin: 16px 12px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.4); font-weight: 700; }
.main { flex: 1; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar__burger { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: grid; place-items: center; cursor: pointer; }
.topbar__title { font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .btn span { display: none; }
.content { padding: 18px 16px 120px; max-width: 1100px; }
.lead { margin: 0 0 18px; color: var(--muted); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 18px; }
.panel--narrow { max-width: 520px; }
.panel__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel__head h2 { font-size: 17px; }
.empty { text-align: center; color: var(--muted); padding: 40px; }
.empty .icon { width: 40px; height: 40px; }
.stack { display: grid; gap: 14px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Dashboard */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; color: var(--text); text-decoration: none !important; }
a.stat:hover { border-color: var(--p); }
.stat__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #e8f1ff; color: var(--pd); flex-shrink: 0; }
.stat__icon--red { background: #fdeaea; color: var(--red); }
.stat__icon--blue { background: #e6f0fd; color: #1d5fbf; }
.stat__icon--amber { background: #fff4dc; color: #b77800; }
.stat__icon--violet { background: #f0eafd; color: #6b3fd1; }
.stat strong { display: block; font-size: 22px; color: var(--dark); line-height: 1.1; }
.stat small { color: var(--muted); font-size: 12px; }
.dash { display: grid; gap: 18px; }
.dash .panel { margin: 0; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { border-bottom: 1px solid var(--line); padding: 10px 0; }
.mini-list li:last-child { border: 0; }
.mini-list a { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; flex-wrap: wrap; }
.mini-list time { margin-left: auto; font-size: 12px; color: var(--muted); }
.mini-list .is-unread strong::after { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--red); border-radius: 50%; margin-left: 6px; vertical-align: middle; }
.score { font-weight: 800; font-size: 20px; color: var(--pd); }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checks li { display: flex; gap: 10px; align-items: center; }
.checks li span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.checks .is-ok span { background: #e8f1ff; color: var(--pd); }
.checks .is-bad span { background: #fdeaea; color: var(--red); }
.checks .is-warn span { background: #fff4dc; color: #b77800; }
.checks .is-ok a { color: var(--text); }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--dark); font-weight: 500; font-size: 14px; text-decoration: none !important; }
.quick a:hover { border-color: var(--p); background: #f2f7ff; }
.quick .icon { color: var(--p); }

/* Editör */
.editor { display: grid; gap: 16px; }
.fields { display: grid; gap: 16px; }
.fields--inline { grid-template-columns: 1fr; }
.field { display: grid; gap: 6px; min-width: 0; }
.field__label { font-weight: 600; font-size: 13px; color: var(--dark); display: flex; justify-content: space-between; gap: 10px; }
.field__help { margin: 0; font-size: 12px; color: var(--muted); }
.field__counter { font-weight: 500; color: var(--muted); font-size: 12px; }
.field__counter.is-good { color: var(--pd); }
.field__counter.is-over { color: var(--red); }
.field--code textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.editor > .fields > .field:not(.field--list):not(.group), .editor > .fields > .field-heading { background: #fff; }
.editor > .fields { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.field-heading { font-size: 15px; padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--line); color: var(--pd); }
.fields > .field-heading:first-child { border: 0; padding-top: 0; margin-top: 0; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { display: flex; align-items: center; padding: 0 10px; background: #f3f6f8; border: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.input-prefix input { border-radius: 0 10px 10px 0; }
.color-row, .icon-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type=color] { width: 52px; padding: 4px; flex-shrink: 0; cursor: pointer; }
.icon-preview { width: 42px; height: 42px; border-radius: 10px; background: #e8f1ff; color: var(--pd); display: grid; place-items: center; flex-shrink: 0; }
.icon-preview svg { width: 24px; height: 24px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; font-size: 14px; color: var(--dark); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__ui { width: 42px; height: 24px; border-radius: 12px; background: #cfd8df; position: relative; transition: background .2s; flex-shrink: 0; }
.switch__ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .switch__ui { background: var(--p); }
.switch input:checked + .switch__ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__ui { box-shadow: 0 0 0 3px rgba(37,99,235,.3); }
.img-field { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.img-thumb { width: 120px; height: 84px; border-radius: 10px; background: #f3f6f8 repeating-conic-gradient(#e9eef2 0 25%, transparent 0 50%) 0 0/16px 16px; border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; flex-shrink: 0; font-size: 12px; color: var(--muted); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-field__side { flex: 1; min-width: 200px; display: grid; gap: 8px; }
.img-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.group { border: 1px solid var(--line); border-radius: var(--r); background: #fafcfd; }
.group > summary { padding: 14px 16px; font-weight: 700; color: var(--dark); cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.group > summary::after { content: "▾"; color: var(--muted); }
.group:not([open]) > summary::after { content: "▸"; }
.group > .fields { padding: 4px 16px 16px; }

/* Listeler */
.list__top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.list__top .field__label { font-size: 14px; }
.list__count { font-size: 12px; color: var(--muted); margin-right: auto; }
.list__items { display: grid; gap: 8px; }
.list__item { background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.list__item.is-open { border-color: #c3d6fb; box-shadow: 0 4px 14px rgba(15,42,61,.06); }
.list__head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; cursor: pointer; min-height: 48px; border-radius: 10px; }
.list__head:hover { background: #f7faff; }
.list__chev { font-size: 20px; color: var(--muted); transition: transform .2s; width: 14px; }
.is-open > .list__head .list__chev { transform: rotate(90deg); }
.list__title { flex: 1; min-width: 0; font-weight: 600; color: var(--dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__actions { display: flex; gap: 4px; flex-shrink: 0; }
.list__body { display: none; padding: 6px 14px 16px; border-top: 1px solid var(--line); }
.is-open > .list__body { display: block; padding-top: 14px; }
.list__body .list__item { background: #fbfcfd; }
.list--inline .list__item { border: 0; background: transparent !important; box-shadow: none !important; display: flex; align-items: center; gap: 8px; }
.list--inline .list__head { order: 2; padding: 0; min-height: 0; background: none !important; cursor: default; }
.list--inline .list__chev, .list--inline .list__title { display: none; }
.list--inline .list__body { display: block; order: 1; flex: 1; padding: 0; border: 0; }
.list--inline .list__body .field__label { display: none; }
.list--inline .fields--inline { gap: 8px; }
.list--inline .btn--dashed { min-height: 36px; }

/* Zengin metin */
.rte { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.rte__bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: #f7f9fa; border-bottom: 1px solid var(--line); position: sticky; top: 66px; z-index: 2; }
.rte__bar button { min-width: 36px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 7px; font-size: 13px; cursor: pointer; padding: 0 8px; color: var(--dark); }
.rte__bar button:hover { border-color: var(--p); color: var(--pd); }
.rte__mode { margin-left: auto; }
.rte__area { min-height: 220px; max-height: 70vh; overflow-y: auto; padding: 14px 16px; border: 0; border-radius: 0; }
.rte__area h2 { font-size: 20px; margin: 1em 0 .4em; }
.rte__area h3 { font-size: 17px; margin: 1em 0 .4em; }
.rte__area > :first-child { margin-top: 0; }
.rte__area img { max-width: 100%; height: auto; border-radius: 8px; }
.rte__src { border: 0; border-radius: 0; font-family: ui-monospace, Consolas, monospace; font-size: 13px; min-height: 260px; }

/* Kaydet çubuğu */
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; display: flex; align-items: center; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(15,42,61,.06); }
.savebar__state { flex: 1; font-size: 13px; color: var(--muted); min-width: 0; }
.savebar__state.is-dirty { color: #b77800; font-weight: 600; }
.savebar .btn--primary { min-width: 120px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); background: var(--dark); color: #fff; padding: 12px 20px; border-radius: 10px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .3s; z-index: 200; max-width: calc(100vw - 32px); text-align: center; }
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast--err { background: var(--red); }
.toast--info { background: #1d5fbf; }

/* Medya */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(15,42,61,.55); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal__box { background: #fff; border-radius: 16px; width: 100%; max-width: 880px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.modal__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 17px; }
.modal__body { padding: 16px 18px; overflow-y: auto; }
.upload-drop { display: block; border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; cursor: pointer; color: var(--muted); margin-bottom: 16px; transition: all .2s; }
.upload-drop:hover, .upload-drop.is-drag { border-color: var(--p); background: #f2f7ff; color: var(--pd); }
.upload-drop input { display: none; }
.upload-drop span { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.media-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; background: #fff; display: flex; flex-direction: column; }
.media-item:hover, .media-item:focus { border-color: var(--p); outline: 0; box-shadow: 0 0 0 3px rgba(37,99,235,.2); }
.media-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #f3f6f8; }
.media-item__name { font-size: 11px; padding: 6px 8px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-item__actions { display: flex; gap: 4px; padding: 0 6px 8px; flex-wrap: wrap; }
.media-grid--manage .media-item { cursor: default; }

/* Mesajlar */
.toolbar { display: grid; gap: 12px; margin-bottom: 16px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap; text-decoration: none !important; }
.chip.is-active { background: var(--dark); color: #fff; border-color: var(--dark); }
.toolbar__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.msgs { display: grid; gap: 8px; }
.msg { background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.msg.is-unread { border-left: 4px solid var(--p); }
.msg summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.msg summary::-webkit-details-marker { display: none; }
.msg.is-unread summary strong { color: var(--dark); }
.msg__sum { flex: 1; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.msg time { font-size: 12px; color: var(--muted); }
.status { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.status--yeni { background: #fdeaea; color: var(--red); }
.status--islemde { background: #fff4dc; color: #b77800; }
.status--tamamlandi { background: #e8f1ff; color: var(--pd); }
.status--iptal { background: #eef1f4; color: var(--muted); }
.msg__body { border-top: 1px solid var(--line); padding: 14px; display: grid; gap: 16px; }
.msg dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; margin: 0; }
.msg dt { font-weight: 600; color: var(--dark); font-size: 13px; }
.msg dd { margin: 0; word-break: break-word; }
.msg__form { display: grid; gap: 10px; background: #f8fafb; padding: 14px; border-radius: 10px; align-content: start; }
.msg__actions { display: flex; gap: 8px; }

/* @lisans:basla */
.meta-list { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0 0 12px; font-size: 14px; }
.meta-list dt { font-weight: 600; color: var(--dark); }
.meta-list dd { margin: 0; word-break: break-word; }
.stack textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
/* Lisans ekranı: .dash sütunlarında alt alta paneller (.dash .panel margin:0 olduğu için aralık burada) */
.dash__col { display: grid; gap: 18px; align-content: start; min-width: 0; }
/* Kırmızı etiket: "Geçersiz" lisans (sipariş durumu .status--yeni yerine; aynı tehlike renkleri) */
.tag--red { background: #fdeaea; color: var(--red); }
/* @lisans:bitir */

/* Tablet+ */
@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .quick { grid-template-columns: repeat(3, 1fr); }
  .fields--inline { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .list--inline .fields--inline { grid-template-columns: 2fr 1fr; }
  .list--inline .fields--inline:has(> :only-child) { grid-template-columns: 1fr; }
  .topbar .btn span { display: inline; }
  .toolbar { grid-template-columns: 1fr auto; align-items: center; }
  .chips { grid-column: 1 / -1; }
  .msg__body { grid-template-columns: 1.4fr 1fr; }
}
@media (min-width: 1024px) {
  .side { transform: none; }
  .side-backdrop, .topbar__burger { display: none !important; }
  .main { margin-left: 260px; }
  .content { padding: 26px 30px 120px; }
  .topbar { padding: 14px 30px; }
  .stats { grid-template-columns: repeat(5, 1fr); }
  .quick { grid-template-columns: repeat(4, 1fr); }
  .dash { grid-template-columns: 1.3fr 1fr; }
  .savebar { left: 260px; padding-left: 30px; padding-right: 30px; }
  .toast { bottom: 100px; margin-left: 130px; }
}
