/* Sıralama Paneli — palet: teal-on-paper, yazı: Hanken Grotesk + DM Mono, köşe: keskin (tasteskill deal) */
:root {
  --p-bg: #f7f9f8; --p-surface: #ebf0ee; --p-ink: #06525c; --p-muted: #2f737d;
  --p-accent: #06525c; --p-accent-ink: #f7f9f8;
  --p-inv-bg: #06525c; --p-inv-surface: #205d66; --p-inv-ink: #f7f9f8; --p-inv-muted: #c1d0d2;
  --card: #ffffff; --line: #d6e0dd; --line-strong: #b9c9c5; --text: #12363b;
  --good: #1d6f45; --good-bg: #e3f2e9; --warn: #8a5300; --warn-bg: #fbefd9; --bad: #a3261b; --bad-bg: #fbe6e3;
  --font-text: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 4px; --r-lg: 6px;
  --shadow: 0 1px 2px rgba(6, 82, 92, .06), 0 2px 8px rgba(6, 82, 92, .05);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--p-bg); color: var(--text); font: 400 15px/1.5 var(--font-text); }
a { color: var(--p-ink); text-decoration: none; background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .2s var(--ease); }
a:hover { background-size: 100% 1px; }
h1, h2, h3 { color: var(--p-ink); font-weight: 500; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.03em; }
h2 { font-size: 18px; line-height: 1.3; }
h3 { font-size: 15px; }
p { margin: 0; }
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--p-muted); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--p-ink); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--p-ink); color: var(--p-accent-ink);
  padding: 10px 14px; border-radius: var(--r); }
.skip:focus { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ iskelet */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--p-inv-bg); color: var(--p-inv-ink); padding: 22px 16px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: var(--p-inv-ink); background: none; }
.brand-mark { width: 30px; height: 30px; border: 1.5px solid var(--p-inv-ink); border-radius: var(--r); display: grid;
  place-items: center; font: 500 13px var(--font-mono); }
.brand-name { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 10px; border-radius: var(--r); color: var(--p-inv-muted);
  background: none; font-weight: 500; min-height: 44px; transition: background-color .15s, color .15s; }
.nav a:hover { background: var(--p-inv-surface); color: var(--p-inv-ink); }
.nav a[aria-current="page"] { background: var(--p-inv-ink); color: var(--p-inv-bg); }
.nav svg { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 8px 0; border-top: 1px solid var(--p-inv-surface); color: var(--p-inv-muted); font-size: 13px; }
.side-foot button { background: none; border: 1px solid var(--p-inv-surface); color: var(--p-inv-ink); }
.main { padding: 28px 36px 48px; min-width: 0; }
.wrap { max-width: 1240px; margin: 0 auto; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar .sub { margin-top: 6px; color: var(--p-muted); }
.crumbs { font-size: 13px; color: var(--p-muted); margin-bottom: 6px; }
.menu-btn { display: none; }

/* ------------------------------------------------------------ bileşenler */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px;
  border-bottom: 1px solid var(--line); }
.card-b { padding: 18px; }
.card + .card, .grid + .card, .card + .grid { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: 2fr 1fr; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 18px; }
.kpi { background: var(--card); padding: 16px 18px; }
.kpi .k { font-size: 12px; color: var(--p-muted); text-transform: none; letter-spacing: .01em; }
.kpi .v { font: 400 28px/1.1 var(--font-mono); color: var(--p-ink); margin-top: 8px; letter-spacing: -0.02em; }
.kpi .d { font-size: 12px; color: var(--p-muted); margin-top: 4px; }

.btn { --b: var(--p-ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
  padding: 0 16px; border-radius: var(--r); border: 1px solid var(--b); background: var(--b); color: var(--p-accent-ink);
  font: 500 14px var(--font-text); cursor: pointer; text-decoration: none; background-image: none;
  transition: transform .15s var(--ease), background-color .15s, box-shadow .15s, color .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(6, 82, 92, .18); background-size: 0; }
.btn:active { transform: translateY(0) scale(.98); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--p-ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--p-ink); box-shadow: none; }
.btn.danger { background: transparent; color: var(--bad); border-color: #e5b8b2; }
.btn.danger:hover { background: var(--bad-bg); box-shadow: none; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 99px; font-size: 12px;
  font-weight: 500; background: var(--p-surface); color: var(--p-ink); white-space: nowrap; }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.up { color: var(--good); } .down { color: var(--bad); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--p-muted); padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: #fbfcfc; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .12s; }
tbody tr:hover { background: #f4f8f7; }
td.r, th.r { text-align: right; }
.table-wrap { overflow-x: auto; }
.empty { padding: 36px 18px; text-align: center; color: var(--p-muted); }
.empty h3 { margin-bottom: 6px; }

form.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--p-ink); }
.hint { font-weight: 400; color: var(--p-muted); font-size: 12px; }
input[type=text], input[type=password], input[type=tel], input[type=search], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: #fff; color: var(--text); font: 400 14px var(--font-text); transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--p-ink); box-shadow: 0 0 0 3px rgba(6, 82, 92, .14); }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }

.flash { padding: 12px 14px; border-radius: var(--r); margin-bottom: 14px; border: 1px solid; font-size: 14px; }
.flash.ok { background: var(--good-bg); color: var(--good); border-color: #b9dfc8; }
.flash.error { background: var(--bad-bg); color: var(--bad); border-color: #efc3bd; }
.flash.info { background: var(--p-surface); color: var(--p-ink); border-color: var(--line-strong); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 11px 14px; color: var(--p-muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-weight: 500; background: none; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
.tabs a:hover { color: var(--p-ink); }
.tabs a[aria-current="page"] { color: var(--p-ink); border-color: var(--p-ink); }

.spark path { fill: none; stroke: var(--p-ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--p-ink); }
.chart text { font: 11px var(--font-mono); fill: var(--p-muted); }
.chart .grid-l { stroke: var(--line); }
.chart .line { fill: none; stroke: var(--p-ink); stroke-width: 2; stroke-linejoin: round; }
.chart .pt { fill: var(--p-ink); stroke: #fff; stroke-width: 2; }
.chart .miss { stroke: var(--bad); stroke-width: 2; }

.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--p-surface); color: var(--p-ink); flex: none;
  display: grid; place-items: center; font: 500 12px var(--font-mono); }
.who .t { min-width: 0; }
.who .t div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

details.pop { position: relative; display: inline-block; }
details.pop > summary { list-style: none; }
details.pop > summary::-webkit-details-marker { display: none; }
details.pop .pop-b { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 280px; background: #fff;
  border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: 0 10px 30px rgba(6, 82, 92, .16); padding: 14px; }

/* ------------------------------------------------------------ sohbet */
.chat { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: min(72vh, 760px); }
.chat-log { overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background:
  linear-gradient(var(--p-bg), var(--p-bg)); }
.msg { max-width: min(640px, 82%); background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 9px 12px 7px; align-self: flex-start; position: relative; }
.msg.out { align-self: flex-end; background: #e6f1ef; border-color: #c7dcd8; }
.msg .meta { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--p-muted); margin-bottom: 3px; }
.msg .meta b { color: var(--p-ink); font-weight: 500; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .media { font-size: 13px; color: var(--p-muted); font-style: italic; }
.msg .reply { font-size: 12px; color: var(--p-muted); border-left: 2px solid var(--line-strong); padding-left: 8px; margin-bottom: 4px; }
.msg .tools { display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transition: opacity .12s; margin-top: 2px; }
.msg:hover .tools, .msg:focus-within .tools { opacity: 1; }
.msg .tools button { border: 0; background: none; color: var(--p-muted); font: 500 12px var(--font-text); cursor: pointer;
  padding: 4px 6px; border-radius: var(--r); min-height: 28px; }
.msg .tools button:hover { background: var(--p-surface); color: var(--p-ink); }
.svc { align-self: center; font-size: 12px; color: var(--p-muted); background: var(--p-surface); padding: 3px 10px; border-radius: 99px; }
.composer { border-top: 1px solid var(--line); padding: 12px; display: grid; grid-template-columns: 200px minmax(0, 1fr) auto;
  gap: 10px; align-items: end; background: #fff; }
.composer textarea { min-height: 44px; max-height: 180px; }
.replying { grid-column: 1 / -1; font-size: 12px; color: var(--p-muted); display: flex; gap: 8px; align-items: center; }
.older { align-self: center; }

/* ------------------------------------------------------------ giriş */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-art { background: var(--p-inv-bg); color: var(--p-inv-ink); padding: 48px; display: flex; flex-direction: column;
  justify-content: space-between; }
.login-art h1 { color: var(--p-inv-ink); font-size: 40px; max-width: 14ch; margin-top: 40px; }
.login-art p { color: var(--p-inv-muted); max-width: 42ch; margin-top: 14px; }
.login-ranks { font: 400 14px/2 var(--font-mono); color: var(--p-inv-muted); border-top: 1px solid var(--p-inv-surface); padding-top: 18px; }
.login-ranks b { color: var(--p-inv-ink); font-weight: 500; }
.login-form { display: grid; place-items: center; padding: 32px; }
.login-form .card { width: min(400px, 100%); }

/* ------------------------------------------------------------ duyarlı */
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s var(--ease); }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(6, 35, 40, .35); }
  .menu-btn { display: inline-flex; }
  .main { padding: 18px 16px 40px; }
  .g2, .row { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .composer { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; } .login-art { display: none; }
  h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* yardımcı sınıflar (CSP satır içi stile izin vermez) */
.end { justify-content: flex-end; }
.lead { margin: 6px 0 18px; }
.mt8 { margin-top: 8px; } .mt10 { margin-top: 10px; } .mt12 { margin-top: 12px; } .mb14 { margin-bottom: 14px; }
.w150 { width: 150px; } .w200 { width: 200px; }
.acting { margin: -8px 0 14px; }
.invite { margin: 8px 0; overflow-wrap: anywhere; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.hint.pad { padding: 12px 18px; }
@media (max-width: 860px) { .w150, .w200 { width: 100%; } }
.btn.menu-btn { display: none; margin-bottom: 14px; }
@media (max-width: 860px) { .btn.menu-btn { display: inline-flex; } }
td.nowrap, .nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
.tabs { overflow-y: hidden; }
/* açılır menüler tablo kaydırma alanında kırpılmasın: kaydırma yalnızca dar ekranda */
.table-wrap { overflow: visible; }
@media (max-width: 860px) { .table-wrap { overflow-x: auto; } details.pop .pop-b { position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; } }
details.pop .pop-b { text-align: left; }
.card-h h2 { flex: none; }
@media (max-width: 1100px) { .g3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) { .g2, .row { grid-template-columns: minmax(0, 1fr); } .card { min-width: 0; } }
