/* =====================================================================
   FRAUD MONITORING — "Denetim Odası" Tasarım Sistemi  v2
   Yön: koyu komuta paneli + kâğıt beyazı çalışma alanı.
   İmza: risk renk dili + monospace "delil" tipografisi (skor/ID/tutar).
   İlkeler (frontend-design + high-end-visual-design):
   hairline + katmanlı yumuşak gölge · double-bezel kartlar · eyebrow
   etiketleri · custom cubic-bezier · transform-only motion · AA kontrast.
   ===================================================================== */
:root {
  /* Zemin ve yüzeyler */
  --ink-950: #0c1420;          /* sidebar zemini — mürekkep */
  --ink-900: #111c2b;
  --ink-800: #1a2740;
  --ink-line: rgba(148, 179, 214, .14);
  --paper: #f6f7f9;            /* çalışma alanı */
  --surface: #ffffff;
  --surface-2: #eef1f5;        /* double-bezel dış tepsi */

  /* Mürekkep tonları (metin) */
  --text: #1d2836;
  --text-2: #5a6b7e;
  --text-3: #8a99ab;

  /* Vurgu — tek renk: derin çelik mavisi */
  --accent: #1f5eab;
  --accent-ink: #17497f;
  --accent-soft: #e8f0fa;

  /* Risk dili (Cilt 1 §11.1 — YALNIZCA risk anlamında) */
  --risk-low: #3e8e5a;   --risk-low-soft: #e7f3ec;
  --risk-mid: #b98a1b;   --risk-mid-soft: #faf3e0;
  --risk-high: #c05621;  --risk-high-soft: #fbeee4;
  --risk-vhigh: #b03a35; --risk-vhigh-soft: #f9e9e8;

  /* Hairline + katmanlı gölge (jenerik 1px gri + sert gölge YASAK) */
  --hairline: rgba(29, 40, 54, .09);
  --hairline-strong: rgba(29, 40, 54, .16);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .05), 0 12px 32px -16px rgba(16, 24, 40, .10);
  --shadow-pop: 0 2px 4px rgba(16, 24, 40, .06), 0 20px 48px -20px rgba(16, 24, 40, .18);

  /* Geometri — konsantrik radius (dış 14 / iç 10) */
  --r-outer: 14px;
  --r-inner: 10px;
  --r-ctl: 8px;

  /* Tipografi — Inter/Roboto/Arial kullanılmaz; kapalı ağda CDN'siz stack */
  --font-ui: "Segoe UI Variable Text", "Segoe UI", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", monospace;

  /* Hareket — fizik hissi veren eğri; linear/ease-in-out kullanılmaz */
  --ease: cubic-bezier(.32, .72, 0, 1);
  --t-fast: 180ms var(--ease);
  --t-med: 320ms var(--ease);
}

* { box-sizing: border-box; }
html { font-size: 14px; }
body {
  margin: 0; font-family: var(--font-ui); color: var(--text);
  background: var(--paper); -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =============================== KABUK =============================== */
.fm-app { display: flex; min-height: 100dvh; }

.fm-sidebar {
  width: 248px; flex: 0 0 248px; display: flex; flex-direction: column;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(31, 94, 171, .16), transparent 60%),
    var(--ink-950);
  border-right: 1px solid var(--ink-line);
  padding: 22px 14px 18px;
}
.fm-brand {
  font-family: var(--font-display); font-size: 15px; font-weight: 650;
  letter-spacing: .14em; color: #eaf1f9; padding: 2px 10px 18px;
  border-bottom: 1px solid var(--ink-line); margin-bottom: 14px;
}
.fm-brand span { color: #6ea8e8; }
.fm-brand small {
  display: block; margin-top: 3px; font-family: var(--font-mono);
  font-size: 9px; letter-spacing: .28em; color: #51637a; font-weight: 400;
}
.fm-nav-section {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .22em;
  color: #4f6178; padding: 16px 10px 7px; font-weight: 600;
}
.fm-nav-item {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; margin: 1px 0; font-size: 13px; color: #b9c7d6;
  text-decoration: none; border-radius: var(--r-ctl);
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.fm-nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .8; }
.fm-nav-item.active svg, .fm-nav-item:hover svg { opacity: 1; }
.fm-nav-item::before {                     /* aktiflik fitili */
  content: ""; width: 3px; height: 0; border-radius: 2px;
  background: #6ea8e8; transition: height var(--t-med);
}
.fm-nav-item:hover { background: rgba(148, 179, 214, .08); color: #eef4fb; }
.fm-nav-item:hover:not(.active) { transform: translateX(2px); }
.fm-nav-item.active { background: rgba(31, 94, 171, .22); color: #fff; font-weight: 600; }
.fm-nav-item.active::before { height: 16px; }
.fm-nav-item.disabled { color: #45566c; cursor: not-allowed; }
.fm-nav-item.disabled::after {
  content: attr(title); margin-left: auto; font-family: var(--font-mono);
  font-size: 8.5px; letter-spacing: .1em; color: #3a4a5e;
  border: 1px solid var(--ink-line); border-radius: 99px; padding: 1px 7px;
}

.fm-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fm-topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
  padding: 13px 32px; position: sticky; top: 0; z-index: 20;
}
.fm-page-title { font-family: var(--font-display); font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.fm-user { display: flex; align-items: center; gap: 12px; }
.fm-user-name {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: 99px; padding: 5px 12px 5px 6px;
}
.fm-user-name::before {
  content: attr(data-initial); display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 99px; background: var(--accent);
  color: #fff; font-size: 10px; font-weight: 700;
}
/* Akışkan: içerik daima mevcut alanı doldurur (sabit px sınır yok).
   Kenar boşluğu viewport'la orantılı; okunabilirlik için çok geniş ekranda
   yalnızca tipografi ölçeği büyür, genişlik %100 kalır. */
.fm-content { padding: 28px clamp(20px, 3vw, 72px) 64px; width: 100%; }
@media (min-width: 1600px) { html { font-size: 15px; } }
@media (min-width: 2200px) { html { font-size: 16px; } }

/* ========================== KART (double-bezel) ========================== */
.fm-card {
  position: relative; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--r-outer);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, .8);
  padding: 22px 26px; margin-bottom: 22px;
}
.fm-card h2 {
  font-family: var(--font-display); font-size: 15px; font-weight: 650;
  letter-spacing: -.01em; margin: 0 0 4px;
}
.fm-card .fm-desc { font-size: 12.5px; color: var(--text-2); margin: 0 0 16px; line-height: 1.55; }

/* Eyebrow — modül etiketi (kart başlığının üstünde) */
.fm-eyebrow {
  display: inline-block; font-family: var(--font-mono); font-size: 9px;
  letter-spacing: .24em; text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); border-radius: 99px; padding: 3px 10px; margin-bottom: 10px;
}

/* ============================== TABLO ============================== */
.fm-card table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.fm-card thead th, .fm-card tr:first-child th {
  text-align: left; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
  color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--hairline-strong);
  white-space: nowrap;
}
.fm-card tbody td, .fm-card tr td {
  padding: 9px 10px; border-bottom: 1px solid var(--hairline); vertical-align: middle;
}
.fm-card tbody tr { transition: background var(--t-fast); }
.fm-card tbody tr:hover { background: #f8fafc; }
.fm-card tbody tr:last-child td { border-bottom: none; }

/* İmza: delil tipografisi */
.fm-mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: -.01em; }
.fm-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.fm-dim { font-size: 11px; color: var(--text-3); }
.fm-nowrap { white-space: nowrap; }

/* BLOKE satırı — risk şeridi */
.fm-row-blocked { box-shadow: inset 3px 0 0 var(--risk-vhigh); background: #fdf7f7; }

/* ============================ ROZETLER ============================ */
.fm-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 99px; font-family: var(--font-mono);
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
}
.fm-pill::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.fm-pill.low   { background: var(--risk-low-soft);   color: var(--risk-low); }
.fm-pill.mid   { background: var(--risk-mid-soft);   color: #8a6614; }
.fm-pill.high  { background: var(--risk-high-soft);  color: var(--risk-high); }
.fm-pill.vhigh { background: var(--risk-vhigh-soft); color: var(--risk-vhigh); }
.fm-pill.grey, .fm-pill[style*="8a8a8a"], .fm-pill[style*="6b7780"] {
  background: var(--surface-2) !important; color: var(--text-2) !important;
}

/* Skor çipi — imza öğesi */
.fm-score {
  display: inline-flex; align-items: baseline; gap: 3px;
  font-family: var(--font-mono); font-weight: 700; font-size: 13px;
}
.fm-score small { font-size: 9px; color: var(--text-3); font-weight: 400; }

/* ============================ DÜĞMELER ============================ */
.fm-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--hairline-strong); border-radius: 99px;
  padding: 7px 16px; font-size: 12.5px; font-weight: 600; font-family: var(--font-ui);
  background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none;
  transition: transform var(--t-fast), box-shadow var(--t-fast),
              background var(--t-fast), border-color var(--t-fast);
}
.fm-btn:hover { border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-card); transform: translateY(-1px); }
.fm-btn:active { transform: scale(.98); }
.fm-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.fm-btn-primary:hover { background: var(--accent-ink); color: #fff; box-shadow: var(--shadow-pop); }
.fm-btn-ghost { border-color: transparent; color: var(--text-2); background: transparent; }
.fm-btn-ghost:hover { background: var(--surface-2); box-shadow: none; }
.fm-btn[disabled] { opacity: .55; cursor: wait; transform: none; }
.fm-btn:focus-visible, .fm-input:focus-visible, .fm-nav-item:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ============================= FORMLAR ============================= */
.fm-label {
  display: block; font-family: var(--font-mono); font-size: 9.5px;
  text-transform: uppercase; letter-spacing: .18em; color: var(--text-3);
  margin-bottom: 5px; font-weight: 600;
}
.fm-input, .rb-input, select.fm-input {
  width: 100%; max-width: 480px; border: 1px solid var(--hairline-strong);
  background: var(--surface); border-radius: var(--r-ctl);
  padding: 8px 11px; font-size: 13px; font-family: var(--font-ui); color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.fm-input:focus, .rb-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 94, 171, .14);
}
.fm-field { margin-bottom: 15px; }
textarea { font-family: var(--font-mono) !important; line-height: 1.6; }
textarea.fm-input, textarea[name], pre {
  border: 1px solid var(--hairline-strong); border-radius: var(--r-inner);
  background: #fbfcfe;
}
pre {
  background: var(--ink-950) !important; color: #c7d6e6; padding: 14px 16px;
  font-family: var(--font-mono); font-size: 11px; overflow-x: auto;
  border-radius: var(--r-inner); border-color: var(--ink-line) !important;
}

/* ============================ UYARILAR ============================ */
.fm-alert {
  border-radius: var(--r-inner); padding: 11px 15px; font-size: 12.5px;
  margin-bottom: 16px; border: 1px solid; display: flow-root;
  animation: fm-slide-in 420ms var(--ease);
}
.fm-alert-success { background: var(--risk-low-soft); border-color: rgba(62,142,90,.3); color: #275c3b; }
.fm-alert-error   { background: var(--risk-vhigh-soft); border-color: rgba(176,58,53,.3); color: #7c2f2b; }
.fm-alert-warn    { background: #fff6e6; border-color: rgba(180,120,20,.3); color: #7a5310; }
@keyframes fm-slide-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.fm-test-result { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; margin-left: 10px; }
.fm-test-result.ok { color: var(--risk-low); }
.fm-test-result.fail { color: var(--risk-vhigh); }

/* ======================= GİRİŞ (double-bezel tam) ======================= */
.fm-anon {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(90% 70% at 85% -10%, rgba(31, 94, 171, .28), transparent 55%),
    radial-gradient(70% 60% at 0% 100%, rgba(62, 142, 90, .10), transparent 50%),
    var(--ink-950);
}
.fm-login-card {
  background: rgba(255, 255, 255, .06);            /* dış tepsi */
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: calc(var(--r-outer) + 8px); padding: 8px; width: 400px;
  box-shadow: var(--shadow-pop);
  animation: fm-rise 700ms var(--ease);
}
.fm-login-card > form, .fm-login-inner {
  background: var(--surface); border-radius: var(--r-outer); padding: 36px 32px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}
.fm-login-brand {
  text-align: center; font-family: var(--font-display); font-weight: 700;
  letter-spacing: .14em; margin-bottom: 6px; font-size: 17px;
}
.fm-login-brand span { color: var(--accent); }
.fm-login-sub {
  text-align: center; font-family: var(--font-mono); font-size: 9px;
  letter-spacing: .3em; color: var(--text-3); text-transform: uppercase; margin-bottom: 26px;
}
@keyframes fm-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ===================== GÖRSEL KURAL OLUŞTURUCU ===================== */
.rb-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 16px;
  background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 99px;
  padding: 3px; width: max-content; }
.rb-tab { padding: 6px 18px; font-size: 12px; font-weight: 600; border: none; background: transparent;
  color: var(--text-2); border-radius: 99px; cursor: pointer; transition: all var(--t-fast); }
.rb-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
.rb-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 18px; margin-bottom: 8px; }
.rb-types { margin: 10px 0 4px; display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
.rb-type { font-size: 12px; white-space: nowrap; font-family: var(--font-mono); }
.rb-group { border: 1px solid var(--hairline); border-radius: var(--r-inner);
  padding: 12px 14px; background: #fafbfd; margin-top: 10px; }
.rb-group.rb-sub { border-style: dashed; margin-left: 24px; background: var(--surface-2); }
.rb-ghead { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.rb-glabel { font-size: 11.5px; color: var(--text-2); flex: 1; }
.rb-row { display: flex; gap: 6px; align-items: center; margin-top: 7px; flex-wrap: wrap; }
.rb-input { max-width: none; width: auto; min-width: 92px; padding: 6px 9px; font-size: 12px; }
.rb-del { border: none; background: none; color: var(--risk-vhigh); cursor: pointer;
  font-size: 13px; padding: 4px 6px; border-radius: 6px; transition: background var(--t-fast); }
.rb-del:hover { background: var(--risk-vhigh-soft); }
.rb-mini { padding: 4px 12px; font-size: 11px; }

/* ========================= KPI ŞERİDİ ========================= */
.fm-kpi-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.fm-kpi {
  --tone: var(--accent); --tone-soft: var(--accent-soft);
  position: relative; overflow: hidden;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--tone-soft) 55%, #fff) 0%, var(--surface) 42%),
    var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--r-outer);
  padding: 16px 18px 15px; box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255,255,255,.7);
  display: flex; flex-direction: column; gap: 9px;
  transition: transform var(--t-med), box-shadow var(--t-med);
}
.fm-kpi::before {                          /* sol renk aksanı — machined kenar */
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--tone);
}
.fm-kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }
.fm-kpi[data-tone="low"]   { --tone: var(--risk-low);   --tone-soft: var(--risk-low-soft); }
.fm-kpi[data-tone="mid"]   { --tone: var(--risk-mid);   --tone-soft: var(--risk-mid-soft); }
.fm-kpi[data-tone="high"]  { --tone: var(--risk-high);  --tone-soft: var(--risk-high-soft); }
.fm-kpi[data-tone="vhigh"] { --tone: var(--risk-vhigh); --tone-soft: var(--risk-vhigh-soft); }

.fm-kpi-top { display: flex; align-items: center; justify-content: space-between; }
.fm-kpi-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-2); font-weight: 600;
}
.fm-kpi-ico {
  width: 30px; height: 30px; padding: 6px; flex: none; color: var(--tone);
  background: color-mix(in srgb, var(--tone-soft) 70%, #fff);
  border: 1px solid color-mix(in srgb, var(--tone) 20%, transparent);
  border-radius: 9px;
}
.fm-kpi-value {
  font-family: var(--font-mono); font-size: 32px; font-weight: 700;
  letter-spacing: -.03em; color: var(--ink-950); line-height: 1;
}
.fm-kpi-value small { font-size: 13px; color: var(--text-3); font-weight: 400; letter-spacing: 0; }
.fm-kpi-bar { height: 5px; border-radius: 99px; background: color-mix(in srgb, var(--tone-soft) 80%, #fff); overflow: hidden; }
.fm-kpi-bar i {
  display: block; height: 100%; border-radius: 99px; background: var(--tone);
  transition: width 640ms var(--ease); min-width: 4px;
}
.fm-kpi-sub { font-size: 10.5px; letter-spacing: .02em; }
.fm-kpi-total { --tone: var(--accent); --tone-soft: var(--accent-soft); }
.fm-kpi-total .fm-kpi-value { font-size: 34px; }

.fm-dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }
.fm-dot.low { background: var(--risk-low); }
.fm-dot.mid { background: var(--risk-mid); }
.fm-dot.vhigh { background: var(--risk-vhigh); }

/* ===================== DASHBOARD BİLEŞENLERİ ===================== */
.fm-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 22px; }

.fm-stat-list { display: flex; flex-direction: column; gap: 8px; }
.fm-stat {
  display: flex; align-items: center; gap: 13px; text-decoration: none; color: inherit;
  padding: 12px 14px; border: 1px solid var(--hairline); border-radius: var(--r-inner);
  background: var(--surface); transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
a.fm-stat:hover { transform: translateX(3px); box-shadow: var(--shadow-card); border-color: var(--hairline-strong); }
.fm-stat-ico {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: 9px; background: var(--surface-2); color: var(--text-2);
}
.fm-stat-ico svg { width: 18px; height: 18px; }
.fm-stat-body { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.fm-stat-body strong { font-size: 13px; font-weight: 600; }
.fm-stat-body small { font-size: 11px; }
.fm-stat-num { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--ink-950); letter-spacing: -.02em; }
.fm-stat.warn { border-color: color-mix(in srgb, var(--risk-mid) 35%, transparent); background: color-mix(in srgb, var(--risk-mid-soft) 40%, #fff); }
.fm-stat.warn .fm-stat-ico { background: var(--risk-mid-soft); color: #8a6614; }
.fm-stat.warn .fm-stat-num { color: #8a6614; }
.fm-stat.danger { border-color: color-mix(in srgb, var(--risk-vhigh) 35%, transparent); background: color-mix(in srgb, var(--risk-vhigh-soft) 40%, #fff); }
.fm-stat.danger .fm-stat-ico { background: var(--risk-vhigh-soft); color: var(--risk-vhigh); }
.fm-stat.danger .fm-stat-num { color: var(--risk-vhigh); }

.fm-health { display: flex; flex-direction: column; gap: 2px; }
.fm-health-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 2px;
  font-size: 13px; border-bottom: 1px solid var(--hairline);
}
.fm-health-item:last-child { border-bottom: none; }
.fm-health-item .fm-dim { margin-left: auto; font-size: 11px; }
.fm-hdot { width: 9px; height: 9px; border-radius: 99px; flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.fm-hdot.ok { background: var(--risk-low); color: var(--risk-low); }
.fm-hdot.warn { background: var(--risk-mid); color: var(--risk-mid); }
.fm-hdot.down { background: var(--risk-vhigh); color: var(--risk-vhigh); }

/* ========================= FİLTRE ÇUBUĞU ========================= */
.fm-filterbar { padding: 16px 20px; }
.fm-filter-grid {
  display: grid; gap: 12px 14px; align-items: end;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}
.fm-filter-grid .fm-input { max-width: none; }
.fm-filter-search { grid-column: span 2; min-width: 200px; }
.fm-filter-actions { display: flex; gap: 8px; }
@media (max-width: 700px) { .fm-filter-search, .fm-filter-actions { grid-column: 1 / -1; } }

/* ========================= TABLO KARTI ========================= */
.fm-tablecard { padding: 0; overflow: hidden; }
.fm-table-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 18px 24px 12px;
}
.fm-table-head h2 { margin: 0; }
.fm-table-scroll { overflow-x: auto; }
.fm-tablecard table { width: 100%; }
.fm-tablecard thead th { padding: 9px 24px; background: var(--surface-2); }
.fm-tablecard tbody td { padding: 11px 24px; }
.fm-tablecard tbody tr:hover { background: #f4f8fd; }
.fm-sla-over { color: var(--risk-vhigh); font-weight: 700; }
.fm-btn-sm { padding: 5px 12px; font-size: 11.5px; }
.fm-empty { text-align: center; padding: 40px 24px !important; color: var(--text-3); font-size: 13px; }

/* ==================== OKUNABİLİR İŞLEM DETAYI ==================== */
.fm-detail-hero {
    --tone: var(--accent); --tone-soft: var(--accent-soft);
    display: flex; justify-content: space-between; align-items: stretch; gap: 24px; flex-wrap: wrap;
    background: linear-gradient(180deg, color-mix(in srgb, var(--tone-soft) 50%, #fff), var(--surface) 60%), var(--surface);
    border: 1px solid var(--hairline); border-left: 4px solid var(--tone);
    border-radius: var(--r-outer); padding: 22px 26px; margin-bottom: 22px; box-shadow: var(--shadow-card);
}
.fm-detail-hero[data-tone="low"] { --tone: var(--risk-low); --tone-soft: var(--risk-low-soft); }
.fm-detail-hero[data-tone="mid"] { --tone: var(--risk-mid); --tone-soft: var(--risk-mid-soft); }
.fm-detail-hero[data-tone="vhigh"] { --tone: var(--risk-vhigh); --tone-soft: var(--risk-vhigh-soft); }
.fm-detail-hero-main { flex: 1; min-width: 280px; }
.fm-detail-title { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; font-family: var(--font-display); font-size: 20px; font-weight: 650; flex-wrap: wrap; }
.fm-detail-explain { font-size: 13.5px; color: var(--text); line-height: 1.6; margin: 0; max-width: 620px; }
.fm-detail-score { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-left: 24px; border-left: 1px solid var(--hairline); }
.fm-detail-score-num { font-family: var(--font-mono); font-size: 44px; font-weight: 700; letter-spacing: -.03em; color: var(--tone); line-height: 1; }
.fm-detail-score-lbl { font-family: var(--font-mono); font-size: 9px; letter-spacing: .18em; color: var(--text-3); margin-top: 6px; }
@media (max-width: 640px) { .fm-detail-score { border-left: none; padding-left: 0; align-items: flex-start; } }

.fm-detail-grouphead { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.fm-detail-grouphead svg { width: 20px; height: 20px; color: var(--accent); }
.fm-detail-grouphead h2 { margin: 0; }

.fm-fieldlist { margin: 0; display: flex; flex-direction: column; }
.fm-fieldrow { display: flex; justify-content: space-between; gap: 20px; padding: 9px 0; border-bottom: 1px solid var(--hairline); }
.fm-fieldrow:last-child { border-bottom: none; }
.fm-fieldrow dt { font-size: 12px; color: var(--text-3); font-weight: 500; flex: none; }
.fm-fieldrow dd { margin: 0; font-size: 13px; text-align: right; font-weight: 500; }

.fm-reasonlist { display: flex; flex-direction: column; gap: 8px; }
.fm-reason { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border: 1px solid var(--hairline); border-radius: var(--r-inner); background: var(--surface); }
.fm-reason-badge { font-family: var(--font-mono); font-weight: 700; font-size: 14px; min-width: 52px; text-align: center; padding: 6px 8px; border-radius: 8px; }
.fm-reason-badge.low { background: var(--risk-low-soft); color: var(--risk-low); }
.fm-reason-badge.mid { background: var(--risk-mid-soft); color: #8a6614; }
.fm-reason-badge.vhigh { background: var(--risk-vhigh-soft); color: var(--risk-vhigh); }
.fm-reason-body { display: flex; flex-direction: column; gap: 1px; }
.fm-reason-body strong { font-size: 13px; }
.fm-reason-body small { font-size: 10.5px; }

.fm-inline-note { padding: 12px 16px; border-radius: var(--r-inner); font-size: 13px; border: 1px solid; display: flex; align-items: center; gap: 8px; }
.fm-inline-note.ok { background: var(--risk-low-soft); border-color: color-mix(in srgb, var(--risk-low) 30%, transparent); color: #275c3b; }
.fm-inline-note.warn { background: var(--risk-mid-soft); border-color: color-mix(in srgb, var(--risk-mid) 30%, transparent); color: #6b5314; }
.fm-inline-note.danger { background: var(--risk-vhigh-soft); border-color: color-mix(in srgb, var(--risk-vhigh) 30%, transparent); color: #7c2f2b; }

.fm-rawdata summary { display: flex; align-items: center; gap: 10px; cursor: pointer; font-family: var(--font-mono); font-size: 12px; color: var(--text-2); list-style: none; }
.fm-rawdata summary::-webkit-details-marker { display: none; }
.fm-rawdata summary svg { width: 16px; height: 16px; }
.fm-rawdata[open] summary { margin-bottom: 4px; color: var(--text); }

/* ============================ SAYFALAMA ============================ */
.fm-pager {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; padding: 14px 24px; border-top: 1px solid var(--hairline);
  background: var(--surface-2);
}
.fm-pager-nav, .fm-pager-size { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.fm-pager-size { font-family: var(--font-mono); font-size: 11px; }
.fm-pager .fm-btn.is-current {
  background: var(--accent); border-color: var(--accent); color: #fff; pointer-events: none;
}
.fm-pager .fm-btn.is-disabled { opacity: .4; pointer-events: none; }
.fm-pager-info { font-size: 12px; }

/* ================= SIDEBAR TOGGLE + HAMBURGER MORPH ================= */
.fm-burger {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 4px;
  width: 38px; height: 38px; padding: 9px 8px; border: 1px solid var(--hairline-strong);
  border-radius: var(--r-ctl); background: var(--surface); cursor: pointer;
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.fm-burger:hover { border-color: var(--accent); }
.fm-burger:active { transform: scale(.94); }
.fm-burger span {
  display: block; height: 2px; border-radius: 2px; background: var(--text);
  transition: transform var(--t-med), opacity var(--t-fast);
  transform-origin: center;
}
/* Masaüstünde hamburger SABİT kalır (konvansiyon: panel daralt/aç, modal değil).
   X'e dönüşüm yalnızca mobil overlay açıkken — orada "kapat" anlamı doğru. */
@media (max-width: 900px) {
  body.nav-open .fm-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  body.nav-open .fm-burger span:nth-child(2) { opacity: 0; transform: scaleX(.4); }
  body.nav-open .fm-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}
.fm-topbar-left { display: flex; align-items: center; gap: 14px; }

.fm-sidebar { transition: transform var(--t-med), margin-left var(--t-med); }
.fm-backdrop {
  position: fixed; inset: 0; z-index: 30; background: rgba(12, 20, 32, .5);
  opacity: 0; pointer-events: none; transition: opacity var(--t-med);
  backdrop-filter: blur(2px);
}

/* Masaüstü: kapatınca sidebar sola kayar, içerik genişler */
@media (min-width: 901px) {
  body:not(.nav-open) .fm-sidebar { margin-left: -248px; transform: translateX(-24px); }
  .fm-backdrop { display: none; }
}

/* ============================ RESPONSIVE ============================ */
@media (max-width: 900px) {
  .fm-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40; width: 248px;
    transform: translateX(-100%); box-shadow: var(--shadow-pop);
  }
  body.nav-open .fm-sidebar { transform: translateX(0); }
  body.nav-open .fm-backdrop { opacity: 1; pointer-events: auto; }
  .fm-topbar { padding: 11px 14px; }
  .fm-content { padding: 18px 14px 40px; }
  .fm-user-name { max-width: 130px; overflow: hidden; }
  .rb-meta { grid-template-columns: 1fr; }
  .fm-card { padding: 16px; border-radius: var(--r-inner); }
  .fm-card > div[style*="display:flex"] { flex-wrap: wrap; gap: 10px; }
  .fm-card table { display: block; overflow-x: auto; }   /* yatay taşma tabloda kalır, sayfada değil */
}

/* --- Denetim İzi + Operasyonel ayar formu (Faz sonrası) --- */
.fm-filter-inline { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.fm-filter-inline .fm-field { margin: 0; }
.fm-fieldset {
  border: 1px solid var(--hairline); border-radius: var(--r-inner);
  padding: 14px 16px 16px; margin: 0 0 16px;
}
.fm-fieldset > legend {
  padding: 0 8px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-2);
}
.fm-audit-diff { max-width: 460px; white-space: normal; word-break: break-word; }
.fm-audit-old { color: var(--risk-vhigh); text-decoration: line-through; opacity: .75; }
.fm-audit-new { color: var(--risk-low); font-weight: 600; }

/* --- Logo linki + Ayarlar alt menüsü --- */
a.fm-brand { display: block; text-decoration: none; cursor: pointer; transition: opacity .2s ease; }
a.fm-brand:hover { opacity: .82; }
.fm-nav-group { }
.fm-nav-group > summary {
  list-style: none; cursor: pointer; user-select: none;
}
.fm-nav-group > summary::-webkit-details-marker { display: none; }
.fm-nav-caret {
  width: 15px; height: 15px; margin-left: auto; opacity: .55;
  transition: transform .25s cubic-bezier(.32,.72,0,1);
}
.fm-nav-group[open] > summary .fm-nav-caret { transform: rotate(90deg); }
.fm-nav-sub {
  margin: 2px 0 4px; padding-left: 14px;
  border-left: 1px solid var(--ink-line); margin-left: 20px;
}
.fm-nav-sub .fm-nav-item { padding-top: 7px; padding-bottom: 7px; font-size: 13px; }

/* --- Sidebar kullanıcı profili (Denetim İzi'nin hemen altında, normal akışta) --- */
.fm-sidebar { overflow-y: auto; overflow-x: hidden; }
.fm-sidebar > nav { flex: 0 0 auto; }
.fm-profile {
  flex: 0 0 auto; margin-top: 48px; padding-top: 14px;
  border-top: 1px solid var(--ink-line);
}
.fm-profile-id { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.fm-profile-avatar {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  color: #eaf1f9; background: linear-gradient(135deg, #2f6fbf, #1f4a86);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.18);
}
.fm-profile-meta { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.fm-profile-meta strong {
  color: #eaf1f9; font-size: 12.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}
.fm-profile-role {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em;
  text-transform: uppercase; color: #6ea8e8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}
.fm-profile-actions { display: flex; gap: 8px; margin-top: 12px; padding: 0 4px; }
.fm-profile-actions > a,
.fm-profile-actions form { flex: 1 1 0; }
.fm-profile-actions .fm-btn { width: 100%; justify-content: center; text-align: center; }

/* --- Kullanıcı/rol izin onay kutuları --- */
.fm-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 16px; }
.fm-check { display: flex; align-items: flex-start; gap: 9px; padding: 6px 8px; border-radius: 8px; cursor: pointer; transition: background .15s ease; }
.fm-check:hover { background: var(--surface-2); }
.fm-check input[type="checkbox"] { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--accent, #2f6fbf); flex: 0 0 auto; }
.fm-check > span { font-size: 13px; line-height: 1.35; }
.fm-check code { display: block; margin-top: 1px; }

/* --- Raporlar: segment kontrolü + grafik kart ızgarası --- */
.fm-seg { display: inline-flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 99px; padding: 3px; margin-top: 6px; }
.fm-seg-item { padding: 5px 14px; font-size: 12.5px; font-weight: 600; color: var(--text-2); text-decoration: none; border-radius: 99px; transition: background var(--t-fast), color var(--t-fast); }
.fm-seg-item:hover { color: var(--text); }
.fm-seg-item.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-card); }
.fm-report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.fm-report-grid .fm-card { margin-bottom: 0; }
.fm-chart-card h2 { margin-bottom: 14px; }
.fm-chart-card { min-height: 120px; }
@media (max-width: 1000px) {
  .fm-report-grid { grid-template-columns: 1fr; }
  .fm-report-grid .fm-card[style*="span 2"] { grid-column: auto !important; }
}

/* --- Bilgi Bankası --- */
.fm-kb-hero h1 { font-family: var(--font-display); font-size: 26px; margin: 4px 0 6px; letter-spacing: -.02em; }
.fm-kb-search { display: flex; align-items: center; gap: 10px; margin-top: 14px; position: relative; flex-wrap: wrap; }
.fm-kb-search svg { width: 18px; height: 18px; position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.fm-kb-search .fm-input { flex: 1 1 280px; max-width: 520px; padding-left: 38px; }
.fm-kb-section { margin-bottom: 26px; }
.fm-kb-section-title { font-family: var(--font-display); font-size: 15px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--hairline); }
.fm-kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.fm-kb-card {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-inner);
  padding: 16px 18px; box-shadow: var(--shadow-card);
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.fm-kb-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.fm-kb-card strong { color: var(--text); font-size: 14px; font-weight: 650; }
.fm-kb-cat { font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.fm-kb-sum { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.fm-kb-more { font-size: 12px; color: var(--accent); font-weight: 600; margin-top: 2px; }

.fm-kb-article-wrap { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 22px; align-items: start; }
.fm-kb-back { display: inline-block; font-size: 12.5px; color: var(--accent); text-decoration: none; margin-bottom: 10px; }
.fm-kb-article h1 { font-family: var(--font-display); font-size: 24px; margin: 4px 0 8px; letter-spacing: -.02em; }
.fm-kb-lead { font-size: 14px; color: var(--text-2); margin: 0 0 18px; padding-bottom: 16px; border-bottom: 1px solid var(--hairline); }
.fm-kb-body { font-size: 14px; line-height: 1.72; color: var(--text); }
.fm-kb-body h3 { font-family: var(--font-display); font-size: 15.5px; margin: 22px 0 8px; }
.fm-kb-body p { margin: 0 0 12px; }
.fm-kb-body ul, .fm-kb-body ol { margin: 0 0 14px; padding-left: 22px; }
.fm-kb-body li { margin-bottom: 6px; }
.fm-kb-body code { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 5px; padding: 1px 6px; color: var(--accent-ink); }
.fm-kb-body .kb-note { background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 10px 14px; font-size: 13px; color: var(--accent-ink); }
.kb-pill { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 1px 8px; border-radius: 99px; color: #fff; }
.kb-pill.low { background: var(--risk-low); } .kb-pill.mid { background: var(--risk-mid); } .kb-pill.vhigh { background: var(--risk-vhigh); }
.fm-kb-related { display: flex; flex-direction: column; gap: 8px; }
.fm-kb-related a { font-size: 13px; color: var(--accent); text-decoration: none; padding: 4px 0; border-bottom: 1px solid var(--hairline); }
.fm-kb-related a:last-child { border-bottom: none; }
@media (max-width: 900px) { .fm-kb-article-wrap { grid-template-columns: 1fr; } }

/* --- İkincil DB önizleme + geçmiş tablosu --- */
.fm-preview-box { margin: 4px 0 14px; border: 1px solid var(--hairline); border-radius: var(--r-inner); overflow: hidden; }
.fm-preview-box table { width: 100%; font-size: 12px; }
.fm-preview-box thead th { background: var(--surface-2); padding: 6px 10px; font-family: var(--font-mono); font-size: 10px; }
.fm-preview-box tbody td { padding: 5px 10px; border-top: 1px solid var(--hairline); }
.fm-exthistory .fm-mono { font-size: 12px; }

/* --- Dashboard uyum kutusu linkleri --- */
.fm-dash-links { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.fm-dash-links a { font-size: 12.5px; color: var(--accent); text-decoration: none; }
.fm-dash-links a:hover { text-decoration: underline; }

/* --- Şüpheli Eşleşme onay kuyruğu --- */
.fm-match-list { display: flex; flex-direction: column; gap: 14px; }
.fm-match {
  --tone: var(--risk-high); --tone-soft: var(--risk-high-soft);
  background: var(--surface); border: 1px solid var(--hairline);
  border-left: 3px solid var(--tone); border-radius: var(--r-inner);
  box-shadow: var(--shadow-card); padding: 16px 20px;
  transition: box-shadow var(--t-fast);
}
.fm-match:hover { box-shadow: var(--shadow-pop); }
.fm-match[data-tone="mid"]   { --tone: var(--risk-mid);   --tone-soft: var(--risk-mid-soft); }
.fm-match[data-tone="high"]  { --tone: var(--risk-high);  --tone-soft: var(--risk-high-soft); }
.fm-match[data-tone="vhigh"] { --tone: var(--risk-vhigh); --tone-soft: var(--risk-vhigh-soft); }

.fm-match-head { display: flex; align-items: center; gap: 16px; }
.fm-match-score {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 62px; padding: 8px 6px; border-radius: 10px;
  background: color-mix(in srgb, var(--tone-soft) 75%, #fff);
  border: 1px solid color-mix(in srgb, var(--tone) 25%, transparent);
}
.fm-match-score-num { font-family: var(--font-mono); font-size: 21px; font-weight: 700; color: var(--tone); line-height: 1; }
.fm-match-score-lbl { font-family: var(--font-mono); font-size: 9px; color: var(--text-3); margin-top: 2px; }
.fm-match-body { min-width: 0; flex: 1; }
.fm-match-name { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 5px; }
.fm-match-name strong { font-size: 14.5px; }
.fm-match-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; color: var(--text-3);
  background: var(--surface-2); border-radius: 5px; padding: 1px 7px; }
.fm-match-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.fm-match-meta a { color: var(--accent); text-decoration: none; }

.fm-match-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--hairline);
}
.fm-match-actions .fm-input { flex: 1 1 240px; min-width: 200px; max-width: none; }
.fm-match-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.fm-match-check input { accent-color: var(--accent); }
.fm-match-btns { display: flex; gap: 8px; margin-left: auto; }
.fm-btn-danger { background: var(--risk-vhigh); border-color: var(--risk-vhigh); color: #fff; }
.fm-btn-danger:hover { background: color-mix(in srgb, var(--risk-vhigh) 88%, #000); }

/* --- Denetim İzi: detaylı eski→yeni --- */
.fm-audit-table td { vertical-align: top; }
.fm-audit-x > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fm-audit-x > summary::-webkit-details-marker { display: none; }
.fm-audit-old { color: var(--risk-vhigh); text-decoration: line-through; opacity: .8; font-size: 12px; }
.fm-audit-new { color: var(--risk-low); font-weight: 600; font-size: 12px; }
.fm-audit-more { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 1px 8px; }
.fm-audit-x[open] > summary .fm-audit-more { background: var(--accent); color: #fff; }
.fm-audit-panel { display: grid; gap: 10px; margin: 10px 0 4px; max-width: 620px; }
.fm-audit-block { border-radius: 8px; border: 1px solid var(--hairline); overflow: hidden; }
.fm-audit-block.old { border-left: 3px solid var(--risk-vhigh); }
.fm-audit-block.new { border-left: 3px solid var(--risk-low); }
.fm-audit-blabel { display: block; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em;
  text-transform: uppercase; padding: 5px 10px; background: var(--surface-2); color: var(--text-2); }
.fm-audit-block.old .fm-audit-blabel { color: #8a2f2b; background: var(--risk-vhigh-soft); }
.fm-audit-block.new .fm-audit-blabel { color: #2c6a44; background: var(--risk-low-soft); }
.fm-audit-block pre { margin: 0; padding: 9px 11px; font-family: var(--font-mono); font-size: 11.5px;
  white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; color: var(--text); }

/* --- Blacklist arama --- */
.fm-bl-search { display: flex; align-items: center; gap: 8px; flex: 1 1 320px; max-width: 560px; }
.fm-bl-search .fm-input { flex: 1; max-width: none; }
.fm-input-sm { padding: 6px 12px; font-size: 12.5px; }
