/* Mengerler Bursa Mesaj Merkezi — siyah kenar, kırık beyaz zemin, gümüş çizgi. */
:root {
    --ink: #0a0a0a;
    --ink-2: #1a1a1a;
    --ink-3: #2a2c2e;
    --bg: #f5f5f3;
    --surface: #ffffff;
    --line: #dcdfe2;
    --silver: #c8ccd0;
    --text: #1a1a1a;
    --muted: #5a5f64;
    --faint: #8a9096;
    --accent: #00adef;
    --accent-ink: #006e99;
    --warn: #a85b00;
    --warn-bg: #fff4e2;
    --bad: #b3261e;
    --bad-bg: #fdecea;
    --ok: #1d6b3a;
    --ok-bg: #e8f4ec;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --side: 236px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 15px/1.5 var(--sans); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--accent-ink); }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #eeefef; padding: 1px 5px; border-radius: 3px; }
code.block { display: block; padding: 10px 12px; overflow-wrap: anywhere; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- kabuk ve sol menü ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); height: 100vh; height: 100dvh; }
.side { background: var(--ink); color: var(--silver); display: flex; flex-direction: column; padding: 22px 12px 12px; overflow-y: auto; }
.brand { display: block; padding: 0 10px 18px; margin-bottom: 16px; border-bottom: 1px solid var(--ink-3); text-decoration: none; }
.brand-name { display: block; font: 600 20px/1.2 var(--serif); letter-spacing: .01em; color: #fff; }
.brand-sub { display: block; margin-top: 5px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }
.side-new { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border-radius: 4px; background: #fff; color: var(--ink); font-weight: 600; text-decoration: none; }
.side-new:hover { background: #e9eaeb; }
.side-title { margin: 22px 10px 6px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 4px; border-left: 2px solid transparent; color: var(--silver); text-decoration: none; }
.side-link:hover { background: var(--ink-2); color: #fff; }
.side-link.on { background: var(--ink-2); border-left-color: var(--accent); color: #fff; font-weight: 600; }
.side-text { flex: 1; min-width: 0; }
.count { min-width: 22px; padding: 0 6px; border-radius: 10px; background: var(--ink-3); color: #fff; font-size: 12px; line-height: 20px; text-align: center; font-weight: 600; }
.side-link.on .count { background: var(--accent); color: var(--ink); }
.side-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 2px; }
.side-tool { display: flex; align-items: center; gap: 11px; width: 100%; padding: 7px 10px; border: 0; border-radius: 4px; background: none; color: var(--faint); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.side-tool:hover { background: var(--ink-2); color: #fff; }
.side-tool[aria-pressed="false"] { text-decoration: line-through; }
.side-user { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 12px 10px 4px; border-top: 1px solid var(--ink-3); }
.side-user-name { flex: 1; min-width: 0; color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-name small { display: block; color: var(--faint); font-weight: 400; font-size: 12px; }
.side-logout, .icon-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px; border: 1px solid transparent; border-radius: 4px; background: none; color: inherit; font: inherit; cursor: pointer; }
.side-logout:hover { background: var(--ink-2); color: #fff; }
.icon-btn:hover { background: #ececea; }
.side-shade, .info-shade { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.mobile-top { display: none; }
.demo-bar { padding: 6px 16px; background: var(--warn-bg); color: var(--warn); font-size: 13px; border-bottom: 1px solid #f0d9b0; }
.flash { margin: 12px 20px 0; padding: 10px 14px; border-radius: 4px; border: 1px solid; font-size: 14px; }
.flash.ok { background: var(--ok-bg); border-color: #b9dcc6; color: var(--ok); }
.flash.err { background: var(--bad-bg); border-color: #f2c1bc; color: var(--bad); }

/* ---------- ortak parçalar ---------- */
.help { color: var(--muted); font-size: 13px; line-height: 1.4; }
.note { color: var(--muted); font-size: 14px; }
.note.warn, .warn { color: var(--warn); }
.hint { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.dim { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.nowrap { white-space: nowrap; }
.wrap { overflow-wrap: anywhere; }
.opt { color: var(--faint); font-weight: 400; font-size: 12px; margin-left: 4px; }
label, .label { display: block; font-weight: 600; font-size: 14px; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--silver); border-radius: 4px; background: #fff; color: var(--text); font: inherit; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: 2px solid var(--accent); outline-offset: 0; }
input[type="checkbox"] { width: 18px; height: 18px; padding: 0; accent-color: var(--ink); }
input[type="file"] { padding: 6px; font-size: 13px; }
input.short { width: 80px; }
textarea { resize: vertical; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > .help { margin-bottom: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--silver); border-radius: 4px; background: #fff; color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--ink-3); }
.btn.danger { color: var(--bad); border-color: #e3b5b0; }
.btn.danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.row { display: flex; gap: 8px; }
.row > input, .row > select { flex: 1; min-width: 0; }
.chip { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; margin-right: 6px; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- görüşmeler: üç sütun ---------- */
.inbox { flex: 1; min-height: 0; display: grid; grid-template-columns: 336px minmax(0, 1fr); }
.has-current .inbox { grid-template-columns: 336px minmax(0, 1fr) 312px; }
.pane-list { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); }
.list-head { padding: 20px 18px 12px; border-bottom: 1px solid var(--line); }
.list-head h1 { font: 600 24px/1.2 var(--serif); }
.list-head .help { margin-top: 4px; }
.search { position: relative; display: block; margin-top: 12px; font-weight: 400; }
.search .ico { position: absolute; left: 9px; top: 9px; width: 18px; height: 18px; color: var(--faint); }
.search input { padding-left: 34px; background: var(--bg); border-color: var(--line); }
#conv-list { flex: 1; min-height: 0; overflow-y: auto; }
.conv { display: block; padding: 12px 18px 12px 16px; border-bottom: 1px solid #eceded; border-left: 2px solid transparent; color: inherit; text-decoration: none; }
.conv:hover { background: #fafaf9; }
.conv.on { background: var(--bg); border-left-color: var(--ink); }
.conv-top, .conv-mid { display: flex; align-items: baseline; gap: 8px; }
.conv-top strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.conv-top time { font-size: 12px; color: var(--faint); }
.conv-mid { margin-top: 1px; }
.preview { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 14px; }
.you { color: var(--faint); }
.badge { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--ink); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.conv.unread .conv-top strong { font-weight: 700; }
.conv.unread .preview { color: var(--text); font-weight: 500; }
.conv.unread .conv-top time { color: var(--accent-ink); font-weight: 600; }
.conv-bot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; }
.tag { padding: 0 7px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); line-height: 18px; }
.tag.plain { border-color: transparent; padding-left: 0; }
.tag.warn { color: var(--warn); }
.wait { margin-left: auto; font-weight: 600; color: var(--muted); }
.wait-warn { color: var(--warn); }
.wait-late { color: var(--bad); }
.none { padding: 28px 18px; color: var(--muted); text-align: center; font-size: 14px; }

.pane-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.empty { margin: auto; max-width: 380px; padding: 24px; text-align: center; color: var(--muted); }
.empty-title { font: 600 22px/1.3 var(--serif); color: var(--text); margin-bottom: 6px; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 14px 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
.thread-who { flex: 1; min-width: 0; }
.thread-who h2 { font: 600 20px/1.25 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-who p { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back, .info-btn { display: none; }
.thread { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 8px; display: flex; flex-direction: column; gap: 10px; }
.thread > * { flex: none; }
.day { text-align: center; margin: 6px 0 2px; }
.day span { display: inline-block; padding: 1px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 12px; }
.msg { max-width: min(76%, 640px); display: flex; flex-direction: column; }
.msg.in { align-self: flex-start; align-items: flex-start; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 9px 13px; border-radius: 10px; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 6px; }
.msg.in .bubble { background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 2px; }
.msg.out .bubble { background: var(--ink-2); color: #fff; border-top-right-radius: 2px; }
.msg.out.system .bubble { background: #e9eaea; color: var(--muted); font-size: 14px; }
.msg.failed .bubble { background: var(--bad-bg); color: var(--bad); border: 1px solid #f2c1bc; }
.meta { margin-top: 3px; font-size: 12px; color: var(--faint); }
.meta.error { color: var(--bad); max-width: 420px; text-align: right; }
.st { margin-left: 4px; letter-spacing: -.12em; }
.st-read { color: var(--accent-ink); font-weight: 700; }
.st-failed { color: var(--bad); letter-spacing: 0; font-weight: 600; }
.st-queued, .st-demo { letter-spacing: 0; }
.media { display: block; max-width: 100%; max-height: 320px; border-radius: 6px; background: #eee; }
.media-link { display: block; }
.media-audio { width: 260px; max-width: 100%; }
.file { font-size: 13px; font-weight: 600; }
.msg.out .file { color: #9bdcf7; }
.media-note { font-size: 13px; color: var(--muted); font-style: italic; }

.composer { padding: 12px 22px 16px; background: var(--surface); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.send-row { display: flex; gap: 10px; align-items: flex-end; }
.send-row textarea { flex: 1; min-height: 46px; max-height: 180px; }
.send-row .btn { height: 46px; padding: 0 22px; }
.send .help { margin-top: 5px; font-size: 12px; color: var(--faint); }
.claim { display: flex; align-items: center; gap: 12px; }
.claim .help { flex: 1; }
.tpl summary, .danger-zone summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.tpl[open] summary { margin-bottom: 10px; color: var(--text); }
.tpl-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }

.pane-info { min-height: 0; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--line); }
.info-head { display: none; }
.info-block { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.info-block h3 { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.facts { display: flex; flex-direction: column; gap: 6px; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.facts dt { color: var(--muted); flex: none; }
.facts dd { text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.action { display: flex; flex-direction: column; gap: 5px; }
.danger-zone summary { color: var(--bad); }
.danger-zone[open] summary { margin-bottom: 10px; }

/* ---------- yönetim sayfaları ve formlar ---------- */
.page { flex: 1; min-height: 0; overflow-y: auto; padding: 30px 34px 60px; }
.page > * { max-width: 1120px; }
.page.narrow > * { max-width: 680px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font: 600 30px/1.2 var(--serif); }
.lead { margin-top: 6px; color: var(--muted); max-width: 720px; }
.legend { margin-bottom: 20px; padding: 12px 16px; border-left: 2px solid var(--silver); background: var(--surface); display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.legend strong { color: var(--text); }
.card { padding: 22px; margin-bottom: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.card h1 { font: 600 22px/1.3 var(--serif); margin-bottom: 8px; }
.card h2 { font-size: 16px; margin-bottom: 14px; }
.card h3 { font-size: 14px; margin: 16px 0 6px; }
.card > p + p { margin-top: 8px; }
.card.stack { display: flex; flex-direction: column; gap: 18px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid-form .span { grid-column: 1 / -1; }
.section-title { font: 600 20px/1.3 var(--serif); margin: 30px 0 4px; }
.section-title + .help { margin-bottom: 12px; max-width: 760px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid #eceded; }
th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--bg); white-space: nowrap; }
th small { display: block; letter-spacing: 0; text-transform: none; font-weight: 400; color: var(--faint); font-size: 12px; }
tr:last-child td { border-bottom: 0; }
tr.off td { background: #fafaf9; color: var(--faint); }
td input:not([type="checkbox"]):not([type="file"]), td select, td textarea { min-width: 130px; }
.media-cell { display: flex; flex-direction: column; gap: 6px; min-width: 200px; font-size: 13px; }
.pager { display: flex; gap: 8px; margin-top: 14px; }
.checks { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.checks li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.checks span { flex: none; width: 54px; font-size: 12px; font-weight: 700; }
.checks .yes span { color: var(--ok); }
.checks .no span { color: var(--bad); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 12px 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { font-weight: 600; }
.plain { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }

/* ---------- giriş ve hata sayfaları ---------- */
.page-login { background: var(--ink); }
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px; }
.login-brand { text-align: center; }
.login-brand .brand-name { font-size: 30px; }
.login .card { width: 100%; max-width: 380px; margin: 0; display: flex; flex-direction: column; gap: 16px; padding: 26px; }
.login .hint { color: var(--faint); max-width: 380px; }
.page-login .flash { position: fixed; top: 0; left: 0; right: 0; margin: 0; border-radius: 0; text-align: center; }

/* ---------- orta genişlik: bilgi sütunu çekmece olur ---------- */
@media (max-width: 1240px) {
    .has-current .inbox { grid-template-columns: 300px minmax(0, 1fr); }
    .inbox { grid-template-columns: 300px minmax(0, 1fr); }
    .info-btn { display: inline-flex; border-color: var(--silver); font-size: 13px; font-weight: 600; padding: 6px 10px; }
    .pane-info { position: fixed; top: 0; right: 0; bottom: 0; width: min(340px, 92vw); z-index: 40; transform: translateX(100%); transition: transform .18s ease; box-shadow: -8px 0 24px rgba(0, 0, 0, .12); }
    .info-open .pane-info { transform: none; }
    .info-open .info-shade { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(10, 10, 10, .35); }
    .info-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); }
    .info-head h2 { font: 600 18px/1.3 var(--serif); }
}

/* ---------- telefon ---------- */
@media (max-width: 900px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .side { position: fixed; top: 0; left: 0; bottom: 0; width: min(280px, 86vw); z-index: 50; transform: translateX(-100%); transition: transform .18s ease; }
    .side-open .side { transform: none; }
    .side-open .side-shade { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(10, 10, 10, .45); }
    .mobile-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--ink); color: #fff; }
    .mobile-top .brand-name { font-size: 17px; }
    .mobile-top .icon-btn:hover { background: var(--ink-2); }
    .inbox, .has-current .inbox { grid-template-columns: minmax(0, 1fr); }
    .has-current .pane-list { display: none; }
    .page-inbox:not(.has-current) .pane-thread { display: none; }
    .back { display: inline-flex; padding: 6px; color: var(--text); }
    .info-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .thread-head { padding: 10px 12px; gap: 8px; }
    .thread { padding: 14px 12px 6px; }
    .msg { max-width: 88%; }
    .composer { padding: 10px 12px 12px; }
    .send .help { display: none; }
    .tpl-form { grid-template-columns: 1fr; }
    .claim { flex-direction: column; align-items: stretch; }
    .page { padding: 20px 14px 50px; }
    .page-head h1 { font-size: 25px; }
    .flash { margin: 10px 12px 0; }
    input, select, textarea { font-size: 16px; }   /* iOS odaklanınca yakınlaştırmasın */
}
@media (prefers-reduced-motion: reduce) {
    .side, .pane-info { transition: none; }
}

/* ---------- toplu gönderim ---------- */
.crumb { font-size: 13px; margin-bottom: 4px; }
.flash.inline { margin: 0 0 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 8px; }
.stats li { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; display: flex; flex-direction: column; gap: 2px; }
.stats strong { font: 600 26px/1.1 var(--serif); }
.stats span { font-size: 12px; color: var(--muted); }
.stats li.bad strong { color: var(--bad); }
.stats + .help { margin-bottom: 22px; }
.card .action { margin-bottom: 16px; gap: 8px; align-items: flex-start; }
.card .action .field { width: 100%; }
input.short-2 { width: 140px; }
.wrap-row { flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.sample { padding: 12px 14px; margin-top: 10px; border-left: 2px solid var(--silver); background: var(--bg); font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.lead .chip { vertical-align: 1px; }
