/* GenLicense v2 Panel - Vercel / Geist estetigi: koyu, monokrom, disiplinli.
   Renk cok az kullanilir; aksan yalnizca durum (ok/warn/danger) ve
   Discord giris butonu icindir. Harici font/CDN yoktur: Geist yerel barinir. */

/* ---- Geist yerel degisken fontlar (woff2, offline) ---- */
@font-face {
  font-family: "Geist";
  src: url("/public/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/public/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Yuzeyler: saf siyahtan cok koyu griye (Vercel katman skalasi) */
  --bg:            #000000;
  --bg-elevated:   #0a0a0a;
  --surface:       #0f0f0f;
  --surface-2:     #161616;
  --surface-hover: #1c1c1c;

  /* Kenarliklar: ince 1px, Vercel griye yakin */
  --border:        #1f1f1f;
  --border-strong: #2a2a2a;
  --border-hover:  #333333;

  /* Metin: yuksek kontrast beyaz + soluk gri kademeleri */
  --text:          #ededed;
  --text-2:        #a1a1a1;
  --text-3:        #6b6b6b;

  /* Durum renkleri (Geist; dusuk doygunlukta kullanilir) */
  --ok:        #17c964;
  --ok-bg:     rgba(23, 201, 100, .10);
  --ok-border: rgba(23, 201, 100, .32);

  --warn:        #f5a623;
  --warn-bg:     rgba(245, 166, 35, .10);
  --warn-border: rgba(245, 166, 35, .32);

  --danger:        #f31260;
  --danger-bg:     rgba(243, 18, 96, .10);
  --danger-border: rgba(243, 18, 96, .34);

  --info:        #52a8ff;
  --info-bg:     rgba(82, 168, 255, .09);
  --info-border: rgba(82, 168, 255, .30);

  --discord:      #5865f2;
  --discord-hover:#4752c4;

  --radius:    8px;
  --radius-sm: 6px;

  --sidebar-w: 236px;

  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* ============================================================
   Global ikon guvenligi: width/height attribute'u olmayan her
   svg makul bir satir-ici boyuta sabitlenir (devasa ikon onlenir).
   Spesifik .nav-link / .menu-btn / .empty-icon boyutlari asagida ezer.
   ============================================================ */
svg:not([width]) {
  width: 1rem;
  height: 1rem;
  flex: none;
  vertical-align: middle;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.006em;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color .12s ease;
}
a:hover { color: #fff; text-decoration: underline; text-underline-offset: 2px; }

/* Klavye odagi: tutarli, net halka (fare tiklaminda gorunmez) */
a:focus-visible,
.nav-link:focus-visible,
.seg-item:focus-visible,
.stat-card-link:focus-visible,
.menu-btn:focus-visible,
.check-item:focus-within {
  outline: 2px solid var(--info);
  outline-offset: 2px;
  border-radius: 4px;
  text-decoration: none;
}

h1, h2, h3 { letter-spacing: -0.021em; font-weight: 600; }

.mono {
  font-family: var(--mono);
  font-variant-ligatures: none;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.small { font-size: 12px; }
.muted { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); }

/* ============================================================
   Yerlesim: sol sidebar + sag icerik sutunu
   ============================================================ */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
.layout-main {
  min-width: 0; /* grid icinde tasma onleme */
  display: flex;
  flex-direction: column;
}

/* ---- Sidebar ---- */
.sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  gap: 4px;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 18px;
}
.brand-dot {
  width: 9px; height: 9px; border-radius: 2px;
  background: var(--text);
  flex: none;
}
.brand-dot.danger { background: var(--danger); }
/* Logo: tek renk mor vurgu, geri kalan marka alani monokrom kalir */
.brand-logo {
  width: 24px; height: 24px;
  border-radius: 6px;
  flex: none;
  display: block;
  object-fit: contain;
}
.brand-name {
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 15px;
  color: var(--text);
}
.brand-sub {
  color: var(--text-3);
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 7px;
  margin-left: 2px;
}

.side-label {
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 500;
  padding: 8px 10px 5px;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
/* Sidebar bolumleri: her grup kucuk uppercase baslik + linkler */
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { margin-top: 12px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13.5px;
  transition: background .12s ease, color .12s ease;
}
.nav-link:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav-link.active { color: var(--text); background: var(--surface-2); }
.nav-link svg { width: 16px; height: 16px; flex: none; opacity: .9; }

.sidebar-foot {
  margin-top: auto;
  padding: 12px 10px 2px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 11px;
}

/* ---- Topbar ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, .72);
  backdrop-filter: saturate(140%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title { font-size: 14px; font-weight: 500; color: var(--text-2); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 12.5px;
  color: var(--text);
}
.user-chip::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
}

/* Mobil menu dugmesi (yalnizca dar ekranda gorunur) */
.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
}
.menu-btn svg { width: 18px; height: 18px; }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 25;
}

/* ---- Icerik kabi ---- */
.container { max-width: 1200px; width: 100%; margin: 0 auto; padding: 32px 28px 72px; }
.container-auth { display: flex; align-items: center; justify-content: center; flex: 1; min-height: 100vh; padding: 40px 20px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.page-head h1 { font-size: 24px; margin: 0; }
.page-head p { margin: 6px 0 0; }

.footer {
  margin-top: auto;
  color: var(--text-3);
  font-size: 12px;
  padding: 20px 28px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   Paneller
   ============================================================ */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 22px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-head + .panel-head { margin-top: 24px; }
.panel-head h2 { font-size: 13.5px; margin: 0; color: var(--text); font-weight: 600; }
.empty { padding: 20px 0; color: var(--text-3); }
.link { color: var(--text-2); font-size: 12.5px; }
.link:hover { color: var(--text); }

/* Sizinti/guvenlik uyarilari icin restrained kirmizi vurgu */
.panel-alert { border-color: var(--danger-border); }
.panel-alert .panel-head h2 { display: flex; align-items: center; gap: 8px; }
.panel-alert .panel-head h2::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-bg);
}

/* ============================================================
   Stat kartlari
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px 18px;
  transition: border-color .12s ease, background .12s ease;
}
.stat-card:hover { border-color: var(--border-hover); background: var(--surface-2); }
.stat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  color: var(--text-2);
  font-size: 12.5px;
  margin-bottom: 12px;
}
/* Etiket metni (nokta + yazi) sol blokta hizali kalir */
.stat-label > span { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
/* Sag-ust kose ikonu: ince, soluk, currentColor */
.stat-ico {
  width: 16px; height: 16px;
  flex: none;
  color: var(--text-3);
  opacity: .85;
}
.stat-num {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
/* Kart altinda opsiyonel kucuk aciklama satiri */
.stat-sub {
  margin-top: 8px;
  color: var(--text-3);
  font-size: 11.5px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--text-3); }
.dot-ok { background: var(--ok); }
.dot-warn { background: var(--warn); }
.dot-danger { background: var(--danger); }

/* ============================================================
   Tablolar
   ============================================================ */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.table th, .table td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table thead th {
  color: var(--text-3);
  font-weight: 500;
  font-size: 12px;
  border-bottom-color: var(--border-strong);
}
.table tbody tr { transition: background .1s ease; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.row-danger { background: var(--danger-bg); }
.row-danger:hover { background: rgba(248, 81, 73, .16); }
.col-actions { white-space: nowrap; width: 1%; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ============================================================
   Rozetler (dusuk doygunluk)
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
}
.badge::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  opacity: .9;
}
.badge-ok     { color: var(--ok);     background: var(--ok-bg);     border-color: var(--ok-border); }
.badge-warn   { color: var(--warn);   background: var(--warn-bg);   border-color: var(--warn-border); }
.badge-danger { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border); }
.badge-muted  { color: var(--text-2); background: var(--surface-2); border-color: var(--border); }
.badge-muted::before { display: none; }

/* ============================================================
   Butonlar
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: -0.006em;
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, color .12s ease, opacity .12s ease;
}
.btn:hover { text-decoration: none; background: var(--surface-2); border-color: var(--border-hover); }
.btn:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { display: flex; width: 100%; }

/* Birincil = beyaz dolu buton, siyah yazi (Vercel "black button" koyu temada ters) */
.btn-primary {
  background: var(--text);
  border-color: var(--text);
  color: #000;
  font-weight: 600;
}
.btn-primary:hover { background: #fff; border-color: #fff; color: #000; }

.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }

/* Durum butonlari: transparan + ince renkli border */
.btn-ok     { border-color: var(--ok-border);     color: var(--ok); }
.btn-ok:hover     { background: var(--ok-bg);     border-color: var(--ok); }
.btn-warn   { border-color: var(--warn-border);   color: var(--warn); }
.btn-warn:hover   { background: var(--warn-bg);   border-color: var(--warn); }
.btn-danger { border-color: var(--danger-border); color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }

.btn-discord { background: var(--discord); border-color: var(--discord); color: #fff; font-weight: 600; padding: 11px 16px; }
.btn-discord:hover { background: var(--discord-hover); border-color: var(--discord-hover); color: #fff; }

.inline { display: inline; margin: 0; }

/* ============================================================
   Formlar
   ============================================================ */
.form .field, .filterbar .field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 500;
}
input[type="text"], input[type="number"], input[type="password"], select, textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { resize: vertical; }
textarea.mono { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-hover);
  box-shadow: 0 0 0 3px rgba(237, 237, 237, .06);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0 18px;
}
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.hint { color: var(--text-3); font-size: 12px; margin: 6px 0 0; }

.filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 22px;
}
.filterbar .field { margin-bottom: 0; min-width: 190px; flex: 1; }
.field-actions { display: flex; gap: 8px; flex: none; }

/* ---- Anahtar/deger listesi ---- */
.kv {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px 16px;
  margin: 0 0 4px;
}
.kv dt { color: var(--text-2); font-size: 13px; }
.kv dd { margin: 0; word-break: break-all; }

.detail-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
@media (max-width: 900px) {
  .detail-cols { grid-template-columns: 1fr; }
}

/* ============================================================
   Bildirimler
   ============================================================ */
.alert {
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 13.5px;
  border: 1px solid transparent;
}
.alert-error { background: var(--danger-bg); color: #ff9c96; border-color: var(--danger-border); }
.alert-info  { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.alert-warn  { background: var(--warn-bg); color: #e6b955; border-color: var(--warn-border); }

/* Aksiyon iceren bildirim: metin + sagda buton */
.banner-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.banner-action .banner-text { min-width: 0; }
.banner-action .btn { flex: none; }

/* Ince saglik satiri: bekleyen talep / guvenlik uyarisi yoksa gosterilir */
.health-ok {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-2);
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  border-radius: var(--radius-sm);
}

/* ============================================================
   Bos durum (empty state)
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 40px 20px;
}
.empty-state .btn { margin-top: 12px; }
.empty-state-sm { padding: 24px 16px; }
.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
}
.empty-icon svg { width: 22px; height: 22px; }
.empty-title { margin: 0; font-weight: 600; color: var(--text); font-size: 14px; }
.empty-state .muted { margin: 0; max-width: 420px; }

/* ============================================================
   Stat kart (link + dikkat cekici)
   ============================================================ */
.stat-card-link { text-decoration: none; color: inherit; display: block; }
.stat-card-link:hover { text-decoration: none; border-color: var(--border-hover); }
.stat-card-attn {
  border-color: var(--warn-border);
  background: linear-gradient(0deg, var(--warn-bg), var(--warn-bg)), var(--surface);
}
.stat-card-attn .stat-num { color: var(--warn); }

/* ============================================================
   Segment secici (gorunum filtresi)
   ============================================================ */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.seg-item {
  padding: 5px 13px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
}
.seg-item:hover { color: var(--text); text-decoration: none; }
.seg-item.active { background: var(--surface-2); color: var(--text); }

/* ============================================================
   Onay kuyrugu: talep kartlari
   ============================================================ */
.request-list { display: flex; flex-direction: column; gap: 16px; }
.request-card { margin-bottom: 0; border-left: 3px solid var(--border-strong); }
.request-card.risk-ok     { border-left-color: var(--ok); }
.request-card.risk-warn   { border-left-color: var(--warn); }
.request-card.risk-danger { border-left-color: var(--danger); }

.request-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.request-id { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.request-id .mono { font-size: 13px; }

/* Risk gostergesi + olcek cubugu */
.risk-indicator { min-width: 170px; flex: none; }
.risk-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.risk-label { font-size: 12px; font-weight: 500; }
.risk-score { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.risk-max { color: var(--text-3); font-size: 11px; font-weight: 500; }
.meter {
  height: 6px;
  width: 100%;
  border-radius: 20px;
  background: var(--surface-2);
  overflow: hidden;
}
.meter-fill { display: block; height: 100%; border-radius: 20px; transition: width .2s ease; }
.meter-ok     { background: var(--ok); }
.meter-warn   { background: var(--warn); }
.meter-danger { background: var(--danger); }

.request-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 18px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.rg-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rg-label { color: var(--text-3); font-size: 11.5px; font-weight: 500; }
.rg-value { color: var(--text); word-break: break-all; }
.ip-change { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ip-arrow { color: var(--text-3); }
.ip-new { color: var(--text); }

.reasons { padding-top: 14px; border-top: 1px solid var(--border); }
.reasons .rg-label { display: block; margin-bottom: 8px; }
.reason-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.reason-badge { font-weight: 500; }
.reason-badge::before { display: none; }

.decision-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.decision-form .field { margin-bottom: 12px; }
.decision-actions { display: flex; gap: 10px; }

.decision-summary { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.decision-summary .rg-label { display: block; margin-bottom: 4px; }
.decision-summary p { margin: 0 0 2px; }
.note-text { color: var(--text-2); font-style: italic; }

/* Dikkat cekilen (pending) satir */
.row-attn { background: var(--warn-bg); }
.row-attn:hover { background: rgba(210, 153, 34, .16); }

/* Islem sirasinda buton geri bildirimi (app.js ekler) */
.btn.is-busy { opacity: .6; pointer-events: none; }
[data-busy].is-submitting { opacity: .75; }

/* ============================================================
   Giris / hata sayfalari
   ============================================================ */
.auth-wrap {
  width: 100%;
  max-width: 400px;
}
.auth-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 32px;
  text-align: center;
}
.auth-brand { margin-bottom: 20px; }
.auth-brand .brand-dot { width: 11px; height: 11px; border-radius: 3px; margin: 0 auto 14px; display: block; }
.auth-brand .brand-logo { width: 52px; height: 52px; border-radius: 12px; margin: 0 auto 16px; }
.auth-brand h1 { margin: 0; font-size: 26px; letter-spacing: -0.03em; }
.auth-brand .muted { margin: 6px 0 0; font-size: 13px; }
.auth-text { color: var(--text-2); font-size: 13.5px; margin: 16px 0 24px; line-height: 1.6; }
.auth-card .btn-block + .btn-block { margin-top: 10px; }

/* ============================================================
   Checkbox coklu secim izgarasi (script / paket secimi)
   ============================================================ */
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
/* Uzun script listesi: kaydirmali kutu (paket 50+ script olunca sayfa sismesin). */
.check-grid-scroll {
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
/* Script arama kutusu: temel input temasiyla ayni + buyutec ikonu + temiz x. */
.script-filter {
  width: 100%;
  margin-bottom: 8px;
  background: var(--bg-elevated) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 11px center;
  background-size: 15px 15px;
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 12px 9px 34px;
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.script-filter::placeholder { color: var(--text-3); }
.script-filter:focus {
  outline: none;
  border-color: var(--border-hover);
  box-shadow: 0 0 0 3px rgba(237, 237, 237, .06);
}
.script-filter::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1a1' stroke-width='2.5' stroke-linecap='round'%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}
.check-item[hidden] { display: none; }
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 400;
  margin: 0;
  transition: border-color .12s ease, background .12s ease;
}
.check-item:hover { border-color: var(--border-hover); background: var(--surface-2); }
.check-item input[type="checkbox"] {
  margin: 1px 0 0; /* metinle ust hizalama; gorunum global ozel stilden gelir */
}
.check-item:has(input:checked) {
  border-color: var(--border-hover);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(237, 237, 237, .04);
}
.check-item:has(input:focus-visible) { border-color: var(--info); }
.check-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.check-text .mono { font-size: 12.5px; word-break: break-all; }
/* Tekil (evet/hayir) secim kutusu: izgara genisligini kaplamaz */
.check-item-single { max-width: 340px; }

/* ============================================================
   Paket kartlari
   ============================================================ */
.pkg-list { display: flex; flex-direction: column; gap: 14px; }
.pkg-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.pkg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.pkg-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pkg-name { font-weight: 600; font-size: 14px; }
.pkg-edit { margin-top: 4px; }

/* ============================================================
   Responsive: dar ekranda sidebar off-canvas
   ============================================================ */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    z-index: 30;
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0, 0, 0, .6); }
  .sidebar-backdrop.open { display: block; }
  .menu-btn { display: inline-flex; }
  .container { padding: 24px 18px 56px; }
  .topbar { padding: 0 18px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* ============================================================
   TAM OZEL FORM KONTROLLERI
   Hicbir tarayici-varsayilan gorunumu kalmaz: checkbox, radio,
   select, input, textarea, scrollbar ve secim tamamen temaya uyar.
   ============================================================ */

/* ---- Checkbox & Radio: native gorunum kaldirilir, Vercel kutu cizilir ---- */
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  flex: none;
  display: inline-grid;
  place-content: center;
  vertical-align: middle;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease;
}
input[type="radio"] { border-radius: 50%; }

input[type="checkbox"]:hover,
input[type="radio"]:hover { border-color: #4d4d4d; }

input[type="checkbox"]:checked {
  background-color: var(--text);
  border-color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 11px 11px;
  background-position: center;
  background-repeat: no-repeat;
}

input[type="radio"]::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  transition: background-color .12s ease;
}
input[type="radio"]:checked { border-color: var(--text); }
input[type="radio"]:checked::after { background: var(--text); }

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid var(--info);
  outline-offset: 2px;
}
input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* ---- Select: native ok kaldirilir, ozel chevron eklenir ---- */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1a1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 15px 15px;
  padding-right: 36px;
  cursor: pointer;
}
select:hover { border-color: var(--border-hover); }
select option { background: var(--bg-elevated); color: var(--text); }

/* ---- Input / Select / Textarea odak: aksan border + hafif glow ---- */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--info);
  box-shadow: 0 0 0 3px var(--info-bg);
}

/* ---- Otomatik doldurma (autofill) rengini koyu temaya zorla ---- */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-elevated) inset;
  box-shadow: 0 0 0 1000px var(--bg-elevated) inset;
  caret-color: var(--text);
  border-color: var(--border-strong);
  transition: background-color 9999s ease-out 0s;
}

/* ---- Buton durumlari: disabled ve basili (active) ---- */
.btn:disabled,
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: .5;
  pointer-events: none;
}
.btn:active { transform: translateY(0.5px); }

/* ---- Ince, koyu scrollbar (webkit + firefox) ---- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-hover) transparent;
}
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 8px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }
::-webkit-scrollbar-corner { background: transparent; }

/* ---- Metin secimi: aksan ---- */
::selection { background: rgba(82, 168, 255, .28); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .btn:active { transform: none; }
}

/* ============================================================
   Gelismis ayarlar (details/summary) + hizli ekleme + yonlendirme
   Mevcut Vercel/Geist paletine sadik; yeni token eklenmez.
   ============================================================ */

/* Katlanabilir "Gelismis ayarlar" bolumu */
.advanced {
  margin-top: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.advanced > summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  color: var(--text);
  transition: background .12s ease;
}
.advanced > summary:hover { background: var(--surface-2); }
.advanced > summary:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(237, 237, 237, .12);
}
.advanced > summary::-webkit-details-marker { display: none; }
.advanced-title {
  font-weight: 600;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.advanced-title::before {
  content: "";
  width: 7px; height: 7px;
  border-right: 1.6px solid var(--text-2);
  border-bottom: 1.6px solid var(--text-2);
  transform: rotate(-45deg);
  transition: transform .15s ease;
}
.advanced[open] .advanced-title::before { transform: rotate(45deg); }
.advanced-body {
  padding: 4px 16px 16px;
  border-top: 1px solid var(--border);
}

/* Yonlendirme kutusu (bos durum: script/paket yok) */
.onboard-box {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 4px 0 8px;
}
.onboard-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 14px;
}

/* Hizli ekleme satiri (scriptler) */
.quick-add .quick-add-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.quick-add .quick-add-row .field {
  margin-bottom: 0;
  flex: 1 1 220px;
  min-width: 180px;
}
.quick-add .quick-add-btn { flex: none; }
.quick-add .hint { margin-top: 10px; }

/* ============================================================
   Lisans anahtari: belirgin kutu + kopyala butonu
   (Mevcut Vercel/Geist token'lari; yeni renk eklenmez.)
   ============================================================ */
.key-box {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}
.key-box-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}
.key-box-label {
  font-size: 12px;
  color: var(--text-3);
}
.key-box-value {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .4px;
  color: var(--text);
  user-select: all;
  word-break: break-all;
}

/* Kopyala butonu: metinli (detay) ve ikon (liste) varyantlari */
.copy-btn { cursor: pointer; }
.copy-btn.is-copied {
  color: var(--ok);
  border-color: var(--ok-border);
  background: var(--ok-bg);
}
.key-cell { display: inline-flex; align-items: center; gap: 6px; }
.copy-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-3);
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.copy-btn-icon svg { width: 13px; height: 13px; }
.copy-btn-icon:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--surface-2);
}
.copy-btn-icon.is-copied {
  color: var(--ok);
  border-color: var(--ok-border);
  background: var(--ok-bg);
}

/* Log satir renkleri: basarili (yesil) / basarisiz (turuncu).
   Sizinti icin mevcut .row-danger kullanilir. */
.row-ok { background: var(--ok-bg); }
.row-ok:hover { background: rgba(23, 201, 100, .16); }
.row-warn { background: var(--warn-bg); }
.row-warn:hover { background: rgba(245, 166, 35, .16); }

/* ============================================================
   Mobil iyilestirmeler (<=640px): kompakt + tablo KART gorunumu
   ============================================================ */
.table-wrap { -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) {
  .container { padding: 16px 12px 48px; }
  .page-head h1 { font-size: 20px; }
  .topbar-right { gap: 6px; }
  .topbar-right .user-chip { max-width: 108px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .filterbar { flex-direction: column; align-items: stretch; }
  .filterbar .field { min-width: 0; width: 100%; }
  .row-actions { flex-wrap: wrap; gap: 6px; }
  .panel { padding: 16px 14px; }
  table.table { font-size: 12.5px; }
  table.table th, table.table td { padding: 8px 8px; }

  /* KART GORUNUMU: .table.cards -> her satir bir kart; hucre etiketleri data-label'dan gelir */
  .table-wrap.cards-wrap { overflow-x: visible; margin: 0; }
  table.table.cards { min-width: 0; }
  table.table.cards thead { display: none; }
  table.table.cards, table.table.cards tbody, table.table.cards tr, table.table.cards td { display: block; width: 100%; }
  table.table.cards tr { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; padding: 4px 14px; background: var(--surface); }
  table.table.cards td { border: none; padding: 8px 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: right; }
  table.table.cards td::before { content: attr(data-label); font-weight: 600; color: var(--text-2); text-align: left; flex: none; white-space: nowrap; }
  table.table.cards td.col-actions { display: block; text-align: left; }
  table.table.cards td.col-actions::before { display: block; margin-bottom: 8px; }
  table.table.cards td.col-actions .row-actions { justify-content: flex-start; }
}

/* ===== Toast (sag-ust anlik bildirim) ===== */
.toast-wrap {
  position: fixed; top: 16px; right: 16px; z-index: 10000;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(92vw, 420px);
}
.toast {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px; line-height: 1.4;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
  cursor: pointer;
  opacity: 0; transform: translateX(16px);
  transition: opacity .22s ease, transform .22s ease;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-info { border-left: 3px solid var(--ok); }
.toast-error { border-left: 3px solid var(--danger); }
@media (max-width: 640px) {
  .toast-wrap { top: 10px; right: 10px; left: 10px; max-width: none; }
}

/* Number input: tarayici varsayilani artis/azalis oklarini kaldir (temiz, tutarli). */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ===== İşlemler bölümü: ayarlar-satırı düzeni (başlık+açıklama | kontrol) ===== */
.action-groups { display: flex; flex-direction: column; }
.action-group {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.action-group:first-child { border-top: none; padding-top: 2px; }
.action-group:last-child { padding-bottom: 2px; }
.action-info { display: flex; flex-direction: column; gap: 3px; min-width: 220px; flex: 1 1 240px; }
.action-title { font-weight: 600; font-size: 14px; color: var(--text); }
.action-desc { color: var(--text-2); font-size: 12.5px; line-height: 1.5; }
.action-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Seçim listesi üst barı: arama kutusu + "(X seçili / Y)" sayacı */
.check-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.check-bar .script-filter { margin-bottom: 0; flex: 1 1 auto; }
.check-count { margin-left: auto; white-space: nowrap; }

/* ========================================================================== */
/* MUSTERI PORTALI (customer-portal) ozel bilesenleri                          */
/* Panel temasi uzerine kurulu; sidebar yerine sade ust bar + indirme listesi. */
/* ========================================================================== */

.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.portal-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text);
}
.portal-brand .brand-name { font-weight: 600; letter-spacing: -.01em; }
.portal-brand .brand-sub {
  font-size: 11px;
  color: var(--text-3);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 1px 6px;
}
.portal-topbar-right { display: flex; align-items: center; gap: 10px; }

.portal-main { padding-top: 28px; padding-bottom: 28px; }

.portal-footer {
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
  padding: 28px 20px 40px;
}
.portal-note { margin-top: 18px; text-align: center; }

/* Lisans blogu */
.license-block { margin-bottom: 18px; }
.license-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.license-title { display: flex; flex-direction: column; gap: 3px; }
.license-title h2 { margin: 0; font-size: 17px; }
.license-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.license-key {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.key-value {
  font-size: 14px;
  color: var(--text);
  letter-spacing: .04em;
  user-select: all;
  word-break: break-all;
}

.dl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.script-filter { max-width: 240px; }
.upd-badge { font-size: 10px; vertical-align: middle; }

/* Ust bar navigasyonu */
.portal-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; margin-right: 14px; }
.portal-nav-link {
  text-decoration: none;
  color: var(--text-2);
  font-size: 13.5px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}
.portal-nav-link:hover { color: var(--text); background: var(--surface-hover); }
.portal-nav-link.active { color: var(--text); background: var(--surface-2); }
@media (max-width: 560px) { .portal-nav { margin-right: 6px; } .portal-nav-link { padding: 6px 7px; font-size: 12.5px; } }

/* Indirilebilir script listesi: cok sayida script olabilir -> kaydirmali. */
.dl-list {
  display: flex;
  flex-direction: column;
  max-height: 460px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.dl-row { border-bottom: 1px solid var(--border); }
.dl-row:last-child { border-bottom: 0; }
.dl-row:hover { background: var(--surface-hover); }
.dl-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
}
.dl-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dl-name { font-size: 13.5px; color: var(--text); word-break: break-all; }
.dl-item-pending { opacity: .62; }
.dl-item-pending:hover { background: transparent; }

/* Surum notu + degisen dosyalar (collapsible) */
.dl-detail { padding: 0 14px 10px; font-size: 13px; }
.dl-detail summary {
  cursor: pointer;
  color: var(--text-2);
  font-size: 12.5px;
  padding: 2px 0;
  user-select: none;
}
.dl-detail summary:hover { color: var(--text); }
.dl-note {
  margin: 8px 0;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  white-space: pre-wrap;
}
.dl-changes {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 300px;
  overflow-y: auto;
}
.diff-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.diff-item:last-child { border-bottom: 0; }
.diff-tag {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .03em;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid transparent;
  min-width: 60px;
  text-align: center;
}
.diff-add { color: var(--ok);     background: var(--ok-bg);     border-color: var(--ok-border); }
.diff-mod { color: var(--warn);   background: var(--warn-bg);   border-color: var(--warn-border); }
.diff-del { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border); }

@media (max-width: 560px) {
  .portal-topbar { padding: 10px 14px; }
  .license-head { flex-direction: column; }
  .dl-item { flex-wrap: wrap; }
}

/* Indirme buton grubu (tam indir + delta + gecmis) */
.dl-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.license-expiry { margin: 0 0 16px; }
@media (max-width: 560px) { .dl-actions { justify-content: flex-start; } }
