/* DKZ yönetim paneli. Koyu, sade, telefonda da okunur. Satır içi stil yok (sıkı içerik güvenliği ilkesi). */
:root {
  --bg: #101010;
  --bg2: #161616;
  --bg3: #1d1d1d;
  --line: #2a2a2a;
  --line2: #383838;
  --text: #ece6da;
  --dim: #a8a196;
  --mute: #6f6a63;
  --red: #f32626;
  --red-dim: #3a1414;
  --green: #45c27a;
  --green-dim: #13301f;
  --amber: #e2a630;
  --amber-dim: #3a2c10;
  --blue: #6aaeff;
  --radius: 4px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-text-size-adjust: 100%; }
a { color: var(--text); text-decoration: none; }
a:hover { color: #fff; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.red { color: var(--red); }
.dim { color: var(--dim); }
.mute { color: var(--mute); }
.mono { font-family: var(--mono); font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.small { font-size: 13px; }

/* ---- Giriş ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-box { width: 100%; max-width: 420px; }
.kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin: 0 0 14px; font-weight: 700; }
.login h1 { font-size: 44px; line-height: 1; margin: 0 0 12px; text-transform: uppercase; font-stretch: condensed; letter-spacing: -.01em; }
.gbtn { margin: 26px 0 10px; min-height: 44px; }
.msg { color: var(--red); min-height: 1.4em; margin: 8px 0 0; font-size: 14px; }
.msg.ok { color: var(--green); }

/* ---- Üst çubuk ---- */
.app { min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px; padding: 0 20px; height: 56px;
  background: rgba(16, 16, 16, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.brand { font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 13px; white-space: nowrap; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 8px 12px; border-radius: var(--radius); color: var(--dim); white-space: nowrap; font-weight: 600; font-size: 14px; }
.nav a:hover { color: var(--text); background: var(--bg3); }
.nav a.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--red); border-radius: 0; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; }
.me { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 13px; white-space: nowrap; }

.view { max-width: 1240px; margin: 0 auto; padding: 24px 20px 80px; outline: none; }

/* ---- Başlıklar ---- */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; }
.head h1 { margin: 0; font-size: 30px; line-height: 1.05; text-transform: uppercase; font-stretch: condensed; letter-spacing: -.005em; }
.head .sub { color: var(--dim); margin-top: 6px; font-size: 14px; }
h2 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin: 30px 0 10px; font-weight: 700; }
h2 .count { color: var(--mute); margin-left: 6px; letter-spacing: 0; }
.back { display: inline-block; color: var(--dim); font-size: 13px; margin-bottom: 10px; }
.back:hover { color: var(--text); }

/* ---- Özet kutucukları ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.tile { background: var(--bg); padding: 16px 16px 14px; }
.tile .v { font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .k { color: var(--dim); font-size: 13px; margin-top: 4px; }
.tile .d { color: var(--mute); font-size: 12px; margin-top: 2px; }
.tile.alert .v { color: var(--red); }
a.tile:hover { background: var(--bg2); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.chart { background: var(--bg2); border: 1px solid var(--line); padding: 14px 14px 8px; }
.chart svg { display: block; width: 100%; height: 120px; }
.chart .axis { display: flex; justify-content: space-between; color: var(--mute); font-size: 11px; margin-top: 4px; }
.bar { fill: var(--text); opacity: .85; }
.bar.hot { fill: var(--red); opacity: 1; }
.bar:hover { opacity: 1; fill: #fff; }
.limit { stroke: var(--red); stroke-dasharray: 3 3; stroke-width: 1; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---- Araç çubuğu ---- */
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.search { flex: 1 1 260px; min-width: 200px; background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--radius); padding: 9px 12px; }
.search:focus, select:focus, input:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: -1px; }
select, .input, textarea { background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--radius); padding: 8px 10px; }
textarea { width: 100%; min-height: 80px; resize: vertical; }
.input { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line2); background: none; padding: 6px 12px; border-radius: 16px; color: var(--dim); cursor: pointer; font-size: 13px; font-weight: 600; }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ---- Düğmeler ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: var(--radius); padding: 9px 14px; background: var(--text); color: var(--bg);
  font-weight: 700; cursor: pointer; font-size: 14px; white-space: nowrap; }
.btn:hover { background: #fff; }
.btn.red { background: var(--red); color: #fff; }
.btn.red:hover { background: #ff4a4a; }
.btn.ghost { background: none; color: var(--text); border: 1px solid var(--line2); }
.btn.ghost:hover { border-color: var(--dim); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--dim); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }

/* ---- Tablo ---- */
.table-wrap { border: 1px solid var(--line); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--mute); font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 10px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--bg2); }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.row { cursor: pointer; }
tr.row:hover td { background: var(--bg2); }
td .sub { color: var(--dim); font-size: 13px; }
.empty { padding: 28px 12px; color: var(--mute); text-align: center; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--dim); font-size: 13px; }

/* ---- Etiketler ---- */
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; line-height: 18px; white-space: nowrap;
  border: 1px solid var(--line2); color: var(--dim); }
.tag.red { background: var(--red-dim); border-color: #6a1d1d; color: #ff8a8a; }
.tag.green { background: var(--green-dim); border-color: #1f5a37; color: #8be0ad; }
.tag.amber { background: var(--amber-dim); border-color: #6a5014; color: #f1c96b; }
.tag.solid { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---- Ayrıntı ---- */
.profile { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; }
.profile h1 { margin: 0; font-size: 32px; line-height: 1.05; text-transform: uppercase; font-stretch: condensed; overflow-wrap: anywhere; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.card { background: var(--bg2); border: 1px solid var(--line); padding: 14px; }
.card h3 { margin: 0 0 8px; font-size: 14px; }
.verdict { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: baseline; padding: 16px; border: 1px solid var(--line); background: var(--bg2); }
.verdict .big { font-size: 26px; font-weight: 800; text-transform: uppercase; font-stretch: condensed; }
.verdict .big.red { color: var(--red); }
.verdict .big.amber { color: var(--amber); }
.verdict .big.green { color: var(--green); }
.reasons { margin: 10px 0 0; padding-left: 18px; color: var(--dim); }
.moves { display: flex; flex-wrap: wrap; gap: 4px 10px; font-family: var(--mono); font-size: 13px; line-height: 1.8; }
.moves .n { color: var(--mute); }
.moves .bad { color: #ff8a8a; }
details { border-top: 1px solid var(--line); padding: 8px 0; }
summary { cursor: pointer; color: var(--dim); }

/* ---- Pencere ve bildirim ---- */
.dialog { background: var(--bg2); color: var(--text); border: 1px solid var(--line2); border-radius: 6px; padding: 0; width: min(480px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(0, 0, 0, .65); }
.dialog form { padding: 20px; }
.dialog h2 { margin: 0 0 14px; font-size: 18px; letter-spacing: 0; text-transform: none; color: var(--text); }
.dialog label { display: block; margin: 12px 0 6px; color: var(--dim); font-size: 13px; }
.dialog .check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 6px;
  font-weight: 600; z-index: 50; max-width: calc(100vw - 32px); }
.toast.err { background: var(--red); color: #fff; }
.loading { color: var(--mute); padding: 40px 0; }

/* ---- Telefon ---- */
@media (max-width: 760px) {
  .top { flex-wrap: wrap; height: auto; padding: 10px 16px 0; gap: 6px 12px; }
  .brand { order: 1; }
  .me { order: 2; margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -16px; padding: 0 10px; }
  .view { padding: 18px 16px 80px; }
  .head h1, .profile h1 { font-size: 26px; }
  .grid2 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile .v { font-size: 24px; }
  /* Tablolar telefonda kart olur: her hücre kendi başlığıyla. */
  .table-wrap { border: 0; overflow: visible; }
  table.rwd thead { display: none; }
  table.rwd tr { display: block; border: 1px solid var(--line); margin-bottom: 8px; background: var(--bg); }
  table.rwd td { display: flex; gap: 12px; justify-content: space-between; border: 0; padding: 6px 12px; text-align: right; }
  table.rwd td .c { min-width: 0; overflow-wrap: anywhere; }
  table.rwd td::before { content: attr(data-label); color: var(--mute); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; text-align: left; flex: none; }
  table.rwd td.main { display: block; text-align: left; padding-top: 10px; font-size: 15px; }
  table.rwd td.main::before { display: none; }
}
