/* Acr Lisans mesaj paneli. Renkler markanın sitesinden ve logodan (../kaynak/NOT.txt): koyu menü, logodaki mavi.
   Mavi #0a74f0 beyaz zeminde metin için 4,4:1 kalıyor; düğme ve bağlantı metninde bir ton koyusu (#0866d6, 5,4:1)
   kullanılır, #0a74f0 odak çerçevesi, etkin menü çizgisi ve ilerleme çubuğunda durur. */
:root {
  --side: #121212;
  --side-2: #1e1e1e;
  --side-line: #2c2c2c;
  --side-ink: #f5f5f5;
  --side-muted: #a8a8a8;
  --brand: #0a74f0;
  --accent: #0866d6;
  --accent-hover: #0756b5;
  --accent-soft: #e8f1fe;
  --accent-line: #bcd6fb;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --field: #7c8ba1;
  --bg: #f8fafc;
  --surface: #ffffff;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --bad: #b91c1c;
  --bad-soft: #fef2f2;
  --radius: 4px;
  --bar: 56px;
  --side-w: 236px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; }
[hidden] { display: none !important; }
h1, h2, h3 { font-weight: 600; line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
img { max-width: 100%; }

/* --- Düğmeler: birincil mavi, ikincil çizgili (.quiet), tehlikeli kırmızı çizgili (.danger) */
button {
  font: inherit; font-weight: 600; font-size: .93rem; line-height: 1.2;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  padding: 9px 16px; border-radius: var(--radius); cursor: pointer; min-height: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center;
}
button:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.quiet { background: var(--surface); color: var(--ink); border-color: var(--field); }
button.quiet:hover:not(:disabled) { background: var(--bg); border-color: var(--ink); }
button.danger { background: var(--surface); color: var(--bad); border-color: var(--bad); }
button.danger:hover:not(:disabled) { background: var(--bad-soft); border-color: var(--bad); }
button.small { min-height: 32px; padding: 5px 10px; font-size: .86rem; }
button.link {
  background: none; border: 0; color: var(--accent); padding: 0; min-height: 0; font-weight: 500;
  text-align: left; justify-content: flex-start; text-decoration: underline; text-underline-offset: 2px;
}
button.link:hover:not(:disabled) { background: none; color: var(--accent-hover); }

/* --- Form */
input, select, textarea {
  font: inherit; font-size: .95rem; width: 100%; padding: 8px 10px; border: 1px solid var(--field); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); min-height: 40px;
}
input[type="file"] { padding: 7px; }
textarea { resize: vertical; line-height: 1.45; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
input:disabled, textarea:disabled { background: var(--bg); color: var(--muted); }
::placeholder { color: #8391a5; }
label { display: block; font-size: .88rem; font-weight: 600; color: var(--ink); margin-top: 14px; margin-bottom: 4px; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 400; margin: 8px 0; min-height: 32px; }
label.check input { width: 18px; height: 18px; min-height: 0; margin: 0; flex-shrink: 0; accent-color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px 14px; margin: 14px 0 0; }
legend { font-size: .88rem; font-weight: 600; padding: 0 4px; }
.stack { display: flex; flex-direction: column; max-width: 560px; }
.stack > button { align-self: flex-start; margin-top: 18px; }
.stack > label:first-child, .stack > h3:first-child + label, .inline > label:first-child { margin-top: 0; }
.inline { max-width: 560px; margin: 16px 0 0; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; }
.row select { flex: 0 0 auto; width: auto; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.actions a { font-size: .9rem; font-weight: 600; padding: 6px 2px; }

/* --- Metin ve durum mesajları */
.hint { color: var(--muted); font-size: .88rem; margin-top: 6px; }
.lede { color: var(--muted); margin-top: 4px; }
.error { color: var(--bad); font-size: .9rem; }
.error:empty { display: none; }
.notice, .flash, .band {
  margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius);
  background: var(--surface); font-size: .93rem;
}
.notice { border-color: #f3d19c; border-left-color: var(--warn); background: var(--warn-soft); color: #7c3a06; }
.flash { border-color: var(--accent-line); border-left-color: var(--brand); background: var(--accent-soft); color: var(--ink); }
.flash.error { border-color: #f5c2c2; border-left-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.band { border-color: #f5c2c2; border-left-color: var(--bad); background: var(--bad-soft); color: #8f1515; font-weight: 600; }
.empty { padding: 18px 16px; color: var(--muted); }
.loading { color: var(--muted); font-size: .9rem; }

/* --- Rozetler: renk her zaman metinle birlikte */
.badge {
  display: inline-block; font-size: .78rem; font-weight: 600; line-height: 1.3; padding: 2px 8px; border-radius: 3px;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted); white-space: nowrap; vertical-align: 1px;
}
.badge.running, .badge.aktif, .badge.done { color: var(--ok); border-color: #b7dfc3; background: var(--ok-soft); }
.badge.queued { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.badge.paused, .badge.bekliyor, .badge.kisitli { color: var(--warn); border-color: #f3d19c; background: var(--warn-soft); }
.badge.reddedildi, .badge.siliniyor { color: var(--bad); border-color: #f5c2c2; background: var(--bad-soft); }
.badge.cancelled, .badge.out { color: var(--muted); }
.badge.new { color: #fff; border-color: var(--accent); background: var(--accent); }

/* --- Giriş ve kayıt */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.login-wrap { width: 100%; max-width: 400px; display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.login-wrap:has(.login-image:not([hidden])) { max-width: 860px; grid-template-columns: minmax(0, 1fr) 400px; }
.login-side { background: var(--side); display: flex; }
.login-side:not(:has(.login-image:not([hidden]))) { display: none; }
.login-image { display: block; width: 100%; height: 100%; min-height: 220px; object-fit: cover; }
.login-box { padding: 32px 32px 28px; display: flex; flex-direction: column; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-logo { display: block; width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
.login-names { display: flex; flex-direction: column; min-width: 0; }
.login-names strong { font-size: 1.05rem; overflow-wrap: anywhere; }
.login-names span { font-size: .88rem; color: var(--muted); overflow-wrap: anywhere; }
.login-box h1 { font-size: 1.35rem; }
.login-text { margin-top: 8px; color: var(--muted); font-size: .92rem; white-space: pre-line; overflow-wrap: anywhere; }
.login-box button[type="submit"] { width: 100%; margin-top: 22px; min-height: 44px; }
.login-box .error { margin-top: 12px; }
.login-alt { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .92rem; color: var(--muted); text-align: center; }
.login-alt a { font-weight: 600; }
.register-done { padding: 4px 0; }
.register-done h2 { font-size: 1.15rem; margin-bottom: 8px; }
.register-done p { color: var(--muted); }
.register-done .btn-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 20px; padding: 9px 16px; width: 100%;
  background: var(--accent); color: #fff; border-radius: var(--radius); font-weight: 600; text-decoration: none; }
.register-done .btn-link:hover { background: var(--accent-hover); color: #fff; }
.login-box label.check { margin-top: 16px; }
label.check.check-top { align-items: flex-start; }
label.check.check-top input { margin-top: 2px; }
/* Gizlilik, kullanım koşulları, veri silme bağlantıları: küçük, soluk */
.legal-links { font-size: .82rem; color: var(--muted); }
.legal-links a { color: var(--muted); white-space: nowrap; }
.legal-links a:hover { color: var(--ink); }
.legal-links a[aria-current="page"] { color: var(--ink); text-decoration: none; }
.login-box .legal-links { margin-top: 16px; text-align: center; }
/* Kayıt formundaki tuzak alan: ekranda ve klavye sırasında yok, yalnız botlar doldurur */
.tuzak { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* Yalnız ekran okuyucunun okuduğu metin (ör. işlem sütununun başlığı) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* --- Gizlilik, kullanım koşulları ve veri silme: okunur genişlikte düz metin */
.legal { max-width: 720px; margin: 0 auto; padding: 28px 20px 48px; line-height: 1.6; overflow-wrap: anywhere; }
.legal-head { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.legal-brand { display: inline-flex; align-items: center; gap: 12px; max-width: 100%; color: var(--ink); text-decoration: none; }
.legal-brand:hover { color: var(--ink); }
.legal-brand strong { font-size: 1.05rem; line-height: 1.3; min-width: 0; }
.legal-body { padding-top: 24px; }
.legal-body h1 { font-size: 1.5rem; margin-bottom: 10px; }
.legal-body h2 { font-size: 1.08rem; margin: 28px 0 8px; }
.legal-body p, .legal-body ul { margin: 0 0 10px; }
.legal-body ul { padding-left: 22px; }
.legal-body li + li { margin-top: 4px; }
.legal-contact { margin: 10px 0 14px; padding: 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.legal-contact div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 3px 0; }
.legal-contact dt { color: var(--muted); font-size: .9rem; }
.legal-contact dd { margin: 0; white-space: pre-line; }
.legal-foot { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; color: var(--muted); font-size: .86rem; }
.legal-foot .legal-links { font-size: .86rem; }

/* --- İskelet: solda koyu menü, sağda içerik */
.shell { min-height: 100vh; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
.side { background: var(--side); color: var(--side-ink); min-height: 100vh; }
.side-inner { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
.side-top { display: flex; align-items: center; gap: 10px; padding: 18px 16px 16px; border-bottom: 1px solid var(--side-line); }
.brand { display: flex; gap: 10px; align-items: center; min-width: 0; flex: 1; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; background: #fff; border-radius: 4px; padding: 2px; }
.brand-names { display: flex; flex-direction: column; min-width: 0; }
.brand-names strong { font-size: .95rem; line-height: 1.2; overflow-wrap: anywhere; }
.brand-names span { font-size: .8rem; color: var(--side-muted); line-height: 1.3; overflow-wrap: anywhere; }
.menu-toggle { display: none; }
.side-menu { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.tabs { display: flex; flex-direction: column; padding: 10px 0; gap: 1px; }
.tabs button {
  justify-content: flex-start; width: 100%; min-height: 40px; padding: 8px 16px 8px 13px; border: 0; border-left: 3px solid transparent;
  border-radius: 0; background: transparent; color: var(--side-muted); font-weight: 500; font-size: .93rem; text-align: left;
}
.tabs button:hover:not(:disabled) { background: var(--side-2); color: var(--side-ink); border-color: transparent; border-left-color: var(--side-line); }
.tabs button.active, .tabs button.active:hover:not(:disabled) { background: var(--side-2); color: #fff; border-left-color: var(--brand); font-weight: 600; }
.tabs button:focus-visible { outline-offset: -2px; }
.nav-group { margin: 14px 16px 4px; font-size: .78rem; font-weight: 600; color: #8a8a8a; }
.nav-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 3px; background: var(--brand); color: #fff; font-size: .76rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.side-user { margin-top: auto; padding: 14px 16px 18px; border-top: 1px solid var(--side-line); display: flex; flex-direction: column; gap: 2px; font-size: .86rem; }
.whoami { color: var(--side-ink); font-weight: 600; overflow-wrap: anywhere; }
.side-plan { color: var(--side-muted); overflow-wrap: anywhere; }
.side-support { color: var(--side-muted); overflow-wrap: anywhere; margin-top: 4px; }
.support-inline { margin-left: 6px; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.side-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; }
.side-links button { background: none; border: 0; padding: 4px 0; min-height: 32px; color: var(--side-ink); font-weight: 500; font-size: .86rem; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #5a5a5a; }
.side-links button:hover:not(:disabled) { background: none; color: #fff; text-decoration-color: currentColor; }
.side-legal { margin-top: 10px; font-size: .78rem; color: var(--side-muted); }
.side-legal a { color: var(--side-muted); white-space: nowrap; text-decoration-color: #5a5a5a; }
.side-legal a:hover { color: #fff; text-decoration-color: currentColor; }

.content { min-width: 0; padding: 28px 32px 72px; }
.content > section, .content > .banners { max-width: 1080px; }
.banners:empty { display: none; }
[data-panel] > h2:first-child { font-size: 1.4rem; }
[data-panel] > h2:first-child + .lede { margin-bottom: 20px; }
[data-panel] > h2:first-child:not(:has(+ .lede)) { margin-bottom: 18px; }
[data-panel] h3 { margin: 28px 0 10px; }
.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 20px; margin-top: 16px; }
.block > h3:first-child, .block-head h3 { margin: 0 0 12px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.block-head h3 { margin: 0; }
.block > .table-wrap:last-child { margin: 0 -20px -20px; border-width: 1px 0 0; border-radius: 0 0 var(--radius) var(--radius); }
.table-gap { margin-top: 12px; }
.form-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-section h4 { margin: 0 0 4px; font-size: .95rem; font-weight: 600; }
.form-section .stack > label:first-child { margin-top: 8px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.split > .block { margin-top: 16px; }

/* --- Bilgi listesi (dl): çizgiyle ayrılmış hücreler, kart yok */
.grid, .facts {
  display: flex; flex-wrap: wrap; gap: 1px; margin: 0 0 16px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.grid:empty, .facts:empty { display: none; }
.grid div, .facts div { flex: 1 1 190px; background: var(--surface); padding: 10px 14px; min-width: 0; }
.grid dt, .facts dt { font-size: .8rem; color: var(--muted); }
.grid dd, .facts dd { margin: 2px 0 0; font-size: .98rem; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* Durum: hesap şeridi */
.strip { display: flex; flex-wrap: wrap; gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.strip div { flex: 1 1 auto; padding: 12px 18px; background: var(--surface); min-width: 0; }
.strip .wide { flex: 2 1 240px; }
.strip dt { font-size: .8rem; color: var(--muted); }
.strip dd { margin: 3px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.strip dd .why { display: block; font-weight: 400; font-size: .88rem; color: var(--muted); margin-top: 2px; }
.usage { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 24px; align-items: end; }
.usage-num { font-size: 1.7rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.usage-num small { font-size: .95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.usage-side { color: var(--muted); font-size: .9rem; text-align: right; }
.usage .meter { grid-column: 1 / -1; margin-top: 8px; }

/* --- Tablo */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 600; font-size: .8rem; color: var(--muted); background: var(--bg); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.hint, td.empty { color: var(--muted); font-size: .9rem; padding: 18px 14px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
td .meta { color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.link-actions { white-space: nowrap; }
.link-actions button + button { margin-left: 6px; }
td.act { text-align: right; white-space: nowrap; }
td.act button + button { margin-left: 6px; }
.table-more { margin-top: 10px; }

/* Grup linkleri: sıra ve kapasite kutuları, doluluk çubuğu */
.links input { width: 5.5em; min-height: 32px; padding: 4px 6px; text-align: right; font-variant-numeric: tabular-nums; }
.links .link-url { overflow-wrap: anywhere; word-break: break-all; min-width: 12em; }
.links .fill { min-width: 170px; }
.fill-line { display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fill .meter { margin-top: 6px; }

/* İlerleme ve doluluk: düz tek renk */
.meter, .bar { height: 6px; background: var(--line); border-radius: 2px; overflow: hidden; }
.meter span, .bar span { display: block; height: 100%; background: var(--brand); }
.meter.full span { background: var(--warn); }

/* --- Kampanyalar */
.camps { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 12px; }
.campaign { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.campaign:last-child { border-bottom: 0; }
.campaign header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 6px 12px; }
.campaign header strong { font-size: 1rem; overflow-wrap: anywhere; }
.campaign .meta { color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }
.campaign .note { color: var(--warn); font-size: .9rem; margin: 8px 0 0; }
.campaign .fail-why { color: var(--bad); font-size: .86rem; margin: 10px 0 12px; overflow-wrap: anywhere; }
.counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px 16px; margin: 14px 0 12px; padding: 0; }
.counts div { min-width: 0; }
.counts dt { font-size: .78rem; color: var(--muted); }
.counts dd { margin: 1px 0 0; font-weight: 600; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.counts .bad-num dd { color: var(--bad); }
.progress-line { display: flex; justify-content: space-between; gap: 12px; font-size: .84rem; color: var(--muted); margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.camp-form { max-width: none; }
.camp-form .stack { max-width: 560px; }

.preview { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-top: 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; }
.preview .problem { color: var(--bad); margin-top: 8px; font-weight: 600; }

.messages { list-style: none; padding: 0; margin: 0; }
.messages li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; }
.messages .who { font-size: .85rem; color: var(--muted); }

/* --- Yönetim */
.assets { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0 8px; }
.asset { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.asset-preview { height: 120px; display: flex; align-items: center; justify-content: center; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 6px; overflow: hidden; }
.asset-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
[data-panel] > .page-head:first-child h2 { font-size: 1.4rem; }
.page-head + .lede { margin-bottom: 20px; }
.page-head + :not(.lede) { margin-top: 18px; }
.actions.tight { margin-top: 0; }
.sub-head { margin: 20px 0 8px; font-size: .9rem; font-weight: 600; }
.block > .grid:last-child { margin-bottom: 0; }
.big-num { font-size: 1.7rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* Özet: sayı kutuları; tıklanabilen kutu listeyi o durumla açar */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.kpi {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 3px; min-width: 0; min-height: 0;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); font-weight: 400; font-size: inherit; line-height: 1.3; text-align: left;
}
.kpi strong { font-size: 1.7rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi-label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.kpi-go { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
button.kpi:hover:not(:disabled) { background: var(--surface); border-color: var(--accent); }
button.kpi .kpi-go { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.kpi.attention { border-color: #f3d19c; border-left: 4px solid var(--warn); padding-left: 13px; }
.kpi.attention strong { color: var(--warn); }

/* Kiracılar: durum sekmeleri (basılı olan seçili) ve satırlar */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { background: var(--surface); color: var(--ink); border-color: var(--line); font-size: .88rem; padding: 7px 12px; min-height: 36px; }
.seg button:hover:not(:disabled) { background: var(--bg); border-color: var(--field); }
.seg button[aria-pressed="true"], .seg button[aria-pressed="true"]:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.seg-count { min-width: 20px; padding: 1px 6px; border-radius: 3px; background: var(--bg); border: 1px solid var(--line); color: var(--ink); font-size: .76rem; font-variant-numeric: tabular-nums; }
.seg-count:empty { display: none; }
.seg button[aria-pressed="true"] .seg-count { background: var(--surface); border-color: var(--accent-line); color: var(--accent); }
td.card-title { font-weight: 600; }
td.card-title .meta { font-weight: 400; }
td .meta.soon { color: var(--warn); font-weight: 600; }

/* Kiracı ayrıntısı: başlık, durum işlemleri, bölüm bağlantıları */
.back-link { font-size: .9rem; margin-bottom: 14px; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 16px; flex-wrap: wrap; }
.detail-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.detail-title h2 { font-size: 1.4rem; overflow-wrap: anywhere; }
.detail-head .actions { margin-top: 0; }
.detail-why {
  margin-top: 12px; padding: 10px 14px; border: 1px solid #f3d19c; border-left-width: 4px; border-left-color: var(--warn); border-radius: var(--radius);
  background: var(--warn-soft); color: #7c3a06; font-size: .93rem; white-space: pre-line; overflow-wrap: anywhere;
}
.jump { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-top: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.jump a { font-weight: 600; text-decoration: none; padding: 4px 0; }
.jump a:hover { text-decoration: underline; }
#admin-detail .block { scroll-margin-top: 16px; }
/* Kiracı ayrıntısında bütün tablolar kartın iç boşluğunda (son tablo da kenara taşmaz) */
#admin-detail .block > .table-wrap:last-child { margin: 0; border-width: 1px; border-radius: var(--radius); }

/* İstatistik: günlük gönderim tek çubukta (okunan, ulaşan, sonucu gelmeyen, başarısız); düz renkler */
.seg-read { --c: var(--accent); }
.seg-deliv { --c: #7fb3f5; }
.seg-wait { --c: #cbd5e1; }
.seg-fail { --c: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 14px 0 10px; font-size: .82rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend span::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.stats-table .bar-col { width: 38%; min-width: 140px; }
.sbar { display: flex; height: 10px; min-width: 3px; border-radius: 2px; overflow: hidden; background: var(--line); }
.sbar span { display: block; height: 100%; background: var(--c); }
#logins-tenant { width: 100%; max-width: 360px; }

/* --- Gelen kutusu: whatsapp web düzeni (müşteri isteği 25.11.2026). Solda arama + kişiler, sağda bej zeminde
   balonlar ve altta yazma çubuğu; masaüstünde sabit yükseklik, iki sütun kendi içinde kayar. Dar ekranda
   liste → yazışma → geri. Renkler yalnız bu bölümde; yuvarlatma panelin kuralıyla en çok 6 px. */
.inbox {
  --wa-panel: #f0f2f5; --wa-chat: #efeae2; --wa-out: #d9fdd3; --wa-in: #ffffff; --wa-ink: #111b21; --wa-muted: #54656f;
  --wa-line: #e9edef; --wa-hover: #f5f6f6; --wa-green: #008069; --wa-green-dark: #006d59; --wa-read: #1789c7;
  display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); margin-top: 12px;
  height: max(460px, calc(100vh - 140px)); overflow: hidden; color: var(--wa-ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.threads-col { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--wa-line); background: var(--surface); }
.threads-search { position: relative; padding: 8px 12px; border-bottom: 1px solid var(--wa-line); }
.threads-search svg { position: absolute; left: 24px; top: 50%; width: 18px; height: 18px; margin-top: -9px; fill: var(--wa-muted); pointer-events: none; }
.threads-search input { min-height: 36px; padding: 6px 12px 6px 40px; background: var(--wa-panel); border-color: transparent; border-radius: 6px; }
.threads-search input:focus-visible { background: var(--surface); }
.threads-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.threads { list-style: none; padding: 0; margin: 0; }
.threads li.hint { padding: 18px 16px; margin: 0; }
.thread {
  display: flex; gap: 12px; align-items: center; width: 100%; min-height: 72px; padding: 0 0 0 12px; text-align: left;
  background: transparent; color: var(--wa-ink); border: 0; border-radius: 0; font-weight: 400; font-size: .95rem;
}
.thread:hover:not(:disabled) { background: var(--wa-hover); border-color: transparent; }
.thread.open, .thread.open:hover:not(:disabled) { background: var(--wa-panel); }
.thread:focus-visible { outline-offset: -2px; }
.t-body { flex: 1; min-width: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding-right: 14px; border-bottom: 1px solid var(--wa-line); }
.thread .t-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.thread .t-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
.thread.unread .t-name { font-weight: 600; }
.thread .t-time { font-size: .75rem; color: var(--wa-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.thread.unread .t-time { color: var(--wa-green); font-weight: 600; }
.thread .t-row { display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.thread .t-last { flex: 1; min-width: 0; font-size: .86rem; color: var(--wa-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread.unread .t-last { color: var(--wa-ink); }
.thread .t-tags { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.badge.wa-new { color: #fff; border-color: var(--wa-green); background: var(--wa-green); }
.avatar {
  flex-shrink: 0; width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; background: #dfe5e7; color: var(--wa-muted); font-weight: 600; font-size: 1rem; letter-spacing: .02em;
}
.avatar svg { width: 30px; height: 30px; fill: #fff; }
#threads-more { margin: 10px 14px; }
.inbox-note { margin: 14px 16px 18px; font-size: .8rem; line-height: 1.45; color: var(--wa-muted); text-align: center; }
/* Hiç yazışma yokken sağdaki boş kutu gösterilmez */
.inbox.empty { grid-template-columns: minmax(0, 1fr); height: auto; padding: 0; }
.inbox.empty .convo-col { display: none; }
.inbox.empty .threads-col { border-right: 0; }
.convo-col { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--wa-panel); }
.convo-empty { margin: auto; max-width: 420px; padding: 40px 32px; text-align: center; color: var(--wa-muted); font-size: .9rem; }
.convo-empty .ce-title { font-size: 1.3rem; color: var(--wa-ink); margin-bottom: 8px; }
.convo { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.convo-head { display: flex; gap: 12px; align-items: center; min-height: 60px; padding: 8px 16px; background: var(--wa-panel); border-bottom: 1px solid var(--wa-line); }
.convo-head .avatar { width: 40px; height: 40px; font-size: .92rem; }
.convo-head .avatar svg { width: 26px; height: 26px; }
.ch-names { min-width: 0; }
.convo-head strong { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo-head .meta { color: var(--wa-muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.icon-btn { min-width: 40px; min-height: 40px; padding: 6px; background: transparent; color: var(--wa-muted); border: 0; border-radius: 6px; }
.icon-btn:hover:not(:disabled) { background: #e2e6e9; border-color: transparent; }
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
#convo-back { display: none; }
.convo-list { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 12px 6% 10px; background: var(--wa-chat); }
.convo-list .day { display: flex; justify-content: center; margin: 12px 0 6px; }
.convo-list .day span, .convo-list .sys {
  font-size: .78rem; color: var(--wa-muted); background: var(--wa-in); padding: 5px 12px; border-radius: 6px; box-shadow: 0 1px .5px rgba(11, 20, 26, .13);
}
.convo-list .sys { width: fit-content; margin: 8px auto; background: #fff5c4; }
.msg {
  position: relative; width: fit-content; max-width: min(65%, 560px); margin: 2px 0; padding: 6px 8px 8px 9px;
  border-radius: 6px; background: var(--wa-in); color: var(--wa-ink); font-size: .93rem; line-height: 1.38; box-shadow: 0 1px .5px rgba(11, 20, 26, .13);
}
.msg.in { margin-right: auto; }
.msg.out { margin-left: auto; background: var(--wa-out); }
.msg.tail { margin-top: 10px; }
.msg.in.tail { border-top-left-radius: 0; }
.msg.out.tail { border-top-right-radius: 0; }
.msg.tail::before { content: ""; position: absolute; top: 0; width: 8px; height: 13px; }
.msg.in.tail::before { left: -8px; background: var(--wa-in); clip-path: polygon(0 0, 100% 0, 100% 100%); }
.msg.out.tail::before { right: -8px; background: var(--wa-out); clip-path: polygon(0 0, 100% 0, 0 100%); }
.msg .body { position: relative; }
.msg .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .meta-gap { display: inline-block; width: 50px; height: 1px; }
.msg.out .meta-gap { width: 68px; }
.msg.out .body:has(.via) .meta-gap { width: 150px; }
.msg .meta {
  position: absolute; right: 0; bottom: -5px; display: inline-flex; align-items: center; gap: 3px;
  font-size: .69rem; color: var(--wa-muted); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.msg .via { margin-right: 4px; }
.camp-label { font-size: .72rem; font-weight: 600; color: var(--wa-green); margin-bottom: 1px; }
.tick { display: inline-flex; }
.tick svg { width: 16px; height: 15px; fill: currentColor; }
.tick.t-read { color: var(--wa-read); }
.tick.t-failed { color: var(--bad); }
.msg .err { margin-top: 6px; padding-top: 4px; border-top: 1px solid rgba(185, 28, 28, .2); font-size: .82rem; color: var(--bad); }
.reply { padding: 8px 14px 10px; background: var(--wa-panel); border-top: 1px solid var(--wa-line); scroll-margin-bottom: 24px; }
.reply-info { margin: 0 0 6px; font-size: .78rem; color: var(--wa-muted); }
.reply-info.reply-info-closed { margin: 0; padding: 10px 12px; font-size: .86rem; color: #7c3a06; background: var(--warn-soft); border: 1px solid #f3d19c; border-radius: var(--radius); }
.reply-box { display: flex; gap: 8px; align-items: flex-end; }
.reply-box textarea {
  flex: 1; min-height: 42px; max-height: 150px; padding: 10px 12px; resize: none; overflow-y: auto; line-height: 1.4;
  background: var(--wa-in); border: 1px solid transparent; border-radius: 6px;
}
.reply-box textarea:focus-visible { outline: 2px solid var(--wa-green); outline-offset: 0; border-color: transparent; }
.send-btn { flex-shrink: 0; width: 44px; min-width: 44px; height: 42px; min-height: 42px; padding: 0; background: var(--wa-green); border-color: var(--wa-green); border-radius: 6px; }
.send-btn:hover:not(:disabled) { background: var(--wa-green-dark); border-color: var(--wa-green-dark); }
.send-btn svg { width: 22px; height: 22px; fill: #fff; }
.send-btn.busy svg { opacity: .5; }
.reply-count { margin: 4px 2px 0; font-size: .78rem; color: var(--wa-muted); text-align: right; font-variant-numeric: tabular-nums; }

/* --- Onay ve şifre pencereleri */
.dialog {
  border: 1px solid var(--line); border-radius: 6px; padding: 0; width: min(440px, calc(100vw - 32px)); color: var(--ink);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
}
.dialog::backdrop { background: rgba(15, 23, 42, .55); }
.dialog form { padding: 22px 22px 18px; max-width: none; }
.dialog h2 { font-size: 1.1rem; margin-bottom: 8px; }
.dialog p { color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.dialog .error { margin-top: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; flex-wrap: wrap; }

@media (prefers-reduced-motion: no-preference) {
  .dialog[open] { animation: dlg-in .14s ease-out; }
  @keyframes dlg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* --- Orta genişlik: menü üstte çubuk, "Menü" düğmesiyle açılır */
/* Kısa masaüstü ekranda (≈800 px) yönetici menüsü kaydırmadan sığsın */
@media (min-width: 900px) and (max-height: 820px) {
  .tabs { padding: 6px 0; }
  .tabs button { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
  .nav-group { margin-top: 10px; }
  .side-user { padding-top: 10px; padding-bottom: 12px; }
}

@media (max-width: 899px) {
  .shell { display: block; }
  .side { position: sticky; top: 0; z-index: 20; min-height: 0; }
  .side-inner { position: static; height: auto; overflow: visible; }
  .side-top { height: var(--bar); padding: 0 8px 0 14px; border-bottom: 0; }
  .brand-logo { width: 32px; height: 32px; }
  .menu-toggle {
    display: inline-flex; min-height: 44px; min-width: 76px; background: transparent; border: 1px solid #4a4a4a; color: var(--side-ink);
  }
  .menu-toggle:hover:not(:disabled) { background: var(--side-2); border-color: #6a6a6a; }
  .menu-toggle[aria-expanded="true"] { background: var(--side-2); border-color: var(--brand); }
  .side-menu { display: none; position: absolute; left: 0; right: 0; top: var(--bar); background: var(--side); border-top: 1px solid var(--side-line);
    max-height: calc(100vh - var(--bar)); overflow-y: auto; box-shadow: 0 12px 24px rgba(0, 0, 0, .25); }
  .shell.menu-open .side-menu { display: flex; }
  .tabs { padding: 6px 0; }
  .tabs button { min-height: 48px; font-size: 1rem; padding-left: 17px; }
  .side-user { padding-bottom: 16px; }
  .side-links button { min-height: 44px; font-size: .95rem; }
  .side-legal { font-size: .86rem; line-height: 2.2; }
  .content { padding: 20px 16px 64px; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 0; }
  button, input, select { min-height: 44px; }
  button.small { min-height: 40px; }
  label.check { min-height: 44px; }
  .seg button { min-height: 40px; }
  #admin-detail .block { scroll-margin-top: calc(var(--bar) + 12px); }
  .inbox { height: max(440px, calc(100vh - var(--bar) - 130px)); }
}

/* --- Telefon: tablolar "etiket: değer" satırlarına döner, formlar tek sütun */
@media (max-width: 720px) {
  .content { padding: 18px 12px 56px; }
  [data-panel] > h2:first-child { font-size: 1.25rem; }
  .block { padding: 16px 14px; }
  .block > .table-wrap:last-child { margin: 0 -14px -16px; }
  .row { flex-direction: column; }
  .row select { width: 100%; }
  .stack > button, .inline .row button { align-self: stretch; width: 100%; }
  .strip div { flex: 1 1 40%; padding: 10px 14px; }
  .strip .wide { flex-basis: 100%; }
  .usage-side { grid-column: 1 / -1; text-align: left; }

  .table-wrap { overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table-wrap tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .table-wrap tbody tr:last-child { border-bottom: 0; }
  .table-wrap td { border: 0; padding: 4px 0; text-align: left; min-width: 0; overflow-wrap: anywhere; }
  .table-wrap td[data-label] { display: grid; grid-template-columns: minmax(92px, 38%) minmax(0, 1fr); gap: 10px; align-items: baseline; }
  .table-wrap td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .82rem; font-weight: 600; }
  .table-wrap td.num { text-align: left; }
  .table-wrap td[colspan] { padding: 8px 0; }
  .table-wrap td.act, .table-wrap td.link-actions { white-space: normal; text-align: left; padding-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
  .table-wrap td.act button + button, .table-wrap .link-actions button + button { margin-left: 0; }
  .table-wrap td.card-title[data-label] { display: block; font-size: 1rem; padding-bottom: 6px; }
  .table-wrap td[data-label] > .badge, .table-wrap td[data-label] > .meta { grid-column: 2; }
  .table-wrap td[data-label] > .badge, .table-wrap td[data-label] > button.link { justify-self: start; }
  .table-wrap td.card-title::before { content: none; }
  .stats-table .bar-col { width: 100%; min-width: 0; }
  .detail-head .actions { width: 100%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi strong { font-size: 1.45rem; }
  #logins-tenant { max-width: none; }
  .links .link-url { min-width: 0; }
  .links .fill { min-width: 0; }
  .fill-line { justify-content: flex-start; }
  .links input { min-height: 40px; }

  /* Telefonda sayfa kayar: başlık üstte, yazma çubuğu altta sabit kalır */
  .inbox { grid-template-columns: minmax(0, 1fr); height: auto; overflow: visible; }
  .threads-col { border-right: 0; }
  .threads-scroll { overflow: visible; }
  .inbox.show-convo .threads-col { display: none; }
  .inbox:not(.show-convo) .convo-col { display: none; }
  .convo-head { position: sticky; top: var(--bar); z-index: 2; padding: 6px 10px 6px 4px; gap: 8px; }
  #convo-back { display: inline-flex; }
  .convo-list { overflow: visible; min-height: 50vh; padding: 10px 12px 8px; }
  .reply { position: sticky; bottom: 0; z-index: 2; padding: 8px; scroll-margin-bottom: 0; }
  .msg { max-width: 85%; }
  .counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .campaign { padding: 14px; }
  .login-box { padding: 26px 20px 22px; }
  .legal { padding: 20px 16px 40px; }
  .legal-body h1 { font-size: 1.3rem; }
  .dialog-actions button { flex: 1 1 auto; }
}

@media (max-width: 900px) and (min-width: 721px) {
  .login-wrap:has(.login-image:not([hidden])) { grid-template-columns: minmax(0, 1fr); max-width: 420px; }
  .login-image { max-height: 200px; }
}
@media (max-width: 720px) {
  .login-wrap:has(.login-image:not([hidden])) { grid-template-columns: minmax(0, 1fr); max-width: 420px; }
  .login-image { max-height: 180px; min-height: 0; }
}
