:root {
  --bg: #f4f6f8; --panel: #ffffff; --ink: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --side: #0b1324; --side-ink: #cbd5e1; --accent: #0f766e; --accent-soft: #ccfbf1;
  --allow: #16a34a; --flag: #d97706; --block: #dc2626;
  --c-toxicity: #ef4444; --c-sexism: #db2777; --c-racism_hate: #7c3aed;
  --c-invest: #2563eb; --c-bet_gamble: #ea580c; --c-fraud: #0891b2; --c-pii: #475569;
  --radius: 10px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 1px 8px rgba(15,23,42,.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg); }
a { color: var(--accent); }
code { background: #f1f5f9; padding: 1px 6px; border-radius: 5px; font-size: 12.5px; word-break: break-all; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--block); min-height: 1.2em; }

/* Giriş */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 20% 0%, #134e4a 0%, #0b1324 55%); }
.login-card { width: 100%; max-width: 380px; background: var(--panel); padding: 28px; border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35); display: grid; gap: 12px; }
.login-card label { display: grid; gap: 4px; font-weight: 500; }

/* İskelet */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.sidebar { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: #fff; padding: 20px 18px; }
.brand.big { color: var(--ink); font-size: 21px; line-height: 1.25; padding: 0; }
.logo { flex: none; width: 26px; height: 26px; border-radius: 7px; background: var(--accent);
  mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path d='M16 2 4 7v8c0 7.5 5.1 13.6 12 15 6.9-1.4 12-7.5 12-15V7z'/></svg>") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path d='M16 2 4 7v8c0 7.5 5.1 13.6 12 15 6.9-1.4 12-7.5 12-15V7z'/></svg>") center/contain no-repeat; }
.brand:not(.big) .logo { background: #2dd4bf; }
nav { display: flex; flex-direction: column; padding: 4px 10px; gap: 2px; flex: 1; overflow-y: auto; }
nav a { display: flex; align-items: center; gap: 10px; color: var(--side-ink); text-decoration: none;
  padding: 8px 10px; border-radius: 8px; }
nav a i { font-style: normal; width: 18px; text-align: center; opacity: .8; }
nav a:hover { background: rgba(255,255,255,.06); }
nav a.active { background: rgba(45,212,191,.14); color: #fff; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #64748b; margin: 14px 10px 4px; }
.badge { margin-left: auto; background: var(--block); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 99px; }
.sidebar-foot { font-size: 11.5px; color: #64748b; padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.06); }
main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.topbar h1 { font-size: 18px; margin: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tenant-pill { background: var(--accent-soft); color: #115e59; padding: 3px 10px; border-radius: 99px; font-weight: 600; font-size: 12.5px; }
.tenant-pill:empty { display: none; }
.page { padding: 20px 24px 48px; display: grid; gap: 16px; }

/* Bileşenler */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card h3 { margin: 0 0 12px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .label { color: var(--muted); font-size: 12.5px; }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi.flag .value { color: var(--flag); } .kpi.block .value { color: var(--block); }
.chart-box { position: relative; height: 260px; }
.chart-box.small { height: 220px; }

.btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 7px 12px; border-radius: 8px;
  cursor: pointer; font: inherit; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #115e59; }
.btn.danger { color: var(--block); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 3px 9px; font-size: 12.5px; }
input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; color: var(--ink); min-width: 0; }
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #99f6e4; border-color: var(--accent); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 12px; cursor: pointer; font: inherit; }
.seg button.on { background: var(--ink); color: #fff; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: #f8fafc; }
tr.fresh { animation: fresh 1.6s ease-out; }
@keyframes fresh { from { background: #ccfbf1; } to { background: transparent; } }
.table-wrap { overflow-x: auto; }
.msg-text { max-width: 520px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; margin: 1px 3px 1px 0; white-space: nowrap; color: #fff; }
.act { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .03em; }
.act.allow { background: #dcfce7; color: #166534; } .act.flag { background: #fef3c7; color: #92400e; } .act.block { background: #fee2e2; color: #991b1b; }
.dir { font-size: 12px; color: var(--muted); white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.up { background: var(--allow); } .down { background: var(--block); }

.scores { display: grid; gap: 8px; }
.score-row { display: grid; grid-template-columns: 150px 1fr 54px; align-items: center; gap: 10px; font-size: 13px; }
.bar { position: relative; height: 10px; background: #f1f5f9; border-radius: 99px; overflow: visible; }
.bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 99px; }
.bar > em { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); opacity: .55; }
.score-row b { text-align: right; font-variant-numeric: tabular-nums; }
.xai { line-height: 2; font-size: 15px; padding: 12px; background: #f8fafc; border-radius: 8px; border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; }
.xai mark { border-radius: 4px; padding: 1px 2px; color: inherit; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { background: #f1f5f9; border-radius: 99px; padding: 2px 10px; font-size: 12.5px; }

.integration { display: grid; gap: 8px; }
.integration .head { display: flex; align-items: center; gap: 10px; }
.int-icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 13px; flex: none; }
.int-slack { background: #4a154b; } .int-teams { background: #4b53bc; } .int-email { background: #0f766e; } .int-webhook { background: #334155; }
.copy-row { display: flex; gap: 6px; align-items: center; } .copy-row code { flex: 1; padding: 6px 8px; }
pre { background: #0b1324; color: #e2e8f0; padding: 14px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; }
.form-grid label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 28px; }
.notice { background: #f0fdfa; border: 1px solid #99f6e4; color: #115e59; padding: 12px 14px; border-radius: 8px; }
.notice.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.big-action { font-size: 22px; font-weight: 800; }

/* Çekmece */
.drawer { position: fixed; inset: 0; z-index: 20; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.35); }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(680px, 100%); background: var(--panel);
  overflow-y: auto; padding: 24px; display: grid; gap: 16px; align-content: start; box-shadow: -10px 0 40px rgba(0,0,0,.15); }
.drawer-close { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 26px; cursor: pointer; color: var(--muted); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 8px; z-index: 30; box-shadow: 0 8px 30px rgba(0,0,0,.25); }

@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  nav { flex-direction: row; flex-wrap: wrap; } .nav-sep, .sidebar-foot { display: none; }
  .g2, .g3, .g-2-1 { grid-template-columns: 1fr; }
  .page { padding: 16px; } .topbar { padding: 12px 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score-row { grid-template-columns: 110px 1fr 46px; }
}
