/* Sell4Gamers Platform — Buz Kobalt teması.

   Koyu görünüm lacivert-grafit yüzeyler, kobalt eylemler ve turkuaz bilgi
   vurguları kullanır. Açık görünüm aynı kimliğin buz grisi karşılığıdır;
   iki tema aynı bileşen koduyla çalışır.

   Yazı tipi kendi sunucumuzdan gelir (static/fonts): CSP dışarıya izin
   vermez ve gizlilik politikası "üçüncü taraf yok" der. */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/static/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/static/fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- jetonlar: açık tema (varsayılan) ---- */
:root {
  --paper: #edf2f8;
  --surface: #fcfdff;
  --surface-2: #e1ebfa;
  --ink: #192a44;
  --ink-2: #344966;
  --muted: #52627b;
  --line: #a4b3c8;
  --line-soft: #d1dbe8;
  --accent: #285bcc;
  --accent-ink: #285bcc;
  --on-accent: #ffffff;
  --accent-wash: #dde7fa;
  --info: #00747b;
  --info-bg: #ddf2f2;
  --ok: #126443;
  --ok-bg: #dcf3e7;
  --bad: #a1263b;
  --bad-bg: #fbe2e8;
  --warn: #765007;
  --warn-bg: #fff0c8;
  --rail: #fcfdff;
  --strip-bg: #142031;
  --strip-ink: #c5d4e8;
  /* Ölçü: 16px yumuşak köşe yerine 12/8. Tablo ve satır yoğun ekranlarda
     büyük yarıçap hizayı bozuyordu; renkler değişmedi, yalnızca ölçü. */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 2px rgba(25, 42, 68, .08);
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", ui-monospace, "SF Mono", Consolas, monospace;
}

/* ---- jetonlar: koyu tema (marka paleti) ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121c2b;
    --surface: #1b283c;
    --surface-2: #243b5c;
    --ink: #eaf1fc;
    --ink-2: #cad8ec;
    --muted: #aabbd2;
    --line: #425b7c;
    --line-soft: #304763;
    --accent: #3269dc;
    --accent-ink: #8db8ff;
    --on-accent: #ffffff;
    --accent-wash: #243b5c;
    --info: #45d6ce;
    --info-bg: #153e46;
    --ok: #78dfb1;
    --ok-bg: #163b30;
    --bad: #ffa5b0;
    --bad-bg: #482934;
    --warn: #ffd280;
    --warn-bg: #45341b;
    --rail: #1b283c;
    --strip-bg: #0b1422;
    --strip-ink: #aabbd2;
    --shadow-card: inset 0 1px 0 rgba(255, 255, 255, .03), 0 1px 2px rgba(0, 0, 0, .2);
  }
}
/* Açık/koyu seçimi çerezden geldiğinde işletim sistemini ezmeli. */
[data-theme="dark"] {
  --paper: #121c2b;
  --surface: #1b283c;
  --surface-2: #243b5c;
  --ink: #eaf1fc;
  --ink-2: #cad8ec;
  --muted: #aabbd2;
  --line: #425b7c;
  --line-soft: #304763;
  --accent: #3269dc;
  --accent-ink: #8db8ff;
  --on-accent: #ffffff;
  --accent-wash: #243b5c;
  --info: #45d6ce;
  --info-bg: #153e46;
  --ok: #78dfb1;
  --ok-bg: #163b30;
  --bad: #ffa5b0;
  --bad-bg: #482934;
  --warn: #ffd280;
  --warn-bg: #45341b;
  --rail: #1b283c;
  --strip-bg: #0b1422;
  --strip-ink: #aabbd2;
  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, .03), 0 1px 2px rgba(0, 0, 0, .2);
}

/* Appearance ekranındaki vurgu seçenekleri. Ortak dosyada dururlar; böylece
   giriş, vitrin, müşteri ve yönetim kabuklarının hepsi aynı seçimi kullanır. */
.accent-cobalt, .accent-blue { --accent:#285bcc; --accent-ink:#285bcc; --on-accent:#fff; --accent-wash:#dde7fa; }
.accent-teal, .accent-green  { --accent:#08776d; --accent-ink:#08776d; --on-accent:#fff; --accent-wash:#dff1ed; }
.accent-violet { --accent:#6d46c2; --accent-ink:#5f3bb5; --on-accent:#fff; --accent-wash:#eee8fb; }
.accent-rose   { --accent:#b72f4a; --accent-ink:#a52c42; --on-accent:#fff; --accent-wash:#fbe8ec; }
.accent-amber  { --accent:#b45309; --accent-ink:#9a4307; --on-accent:#fff; --accent-wash:#fff0d8; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]).accent-cobalt,
  :root:not([data-theme="light"]).accent-blue   { --accent:#3269dc; --accent-ink:#8db8ff; --on-accent:#fff; --accent-wash:#243b5c; }
  :root:not([data-theme="light"]).accent-teal,
  :root:not([data-theme="light"]).accent-green  { --accent:#45d6ce; --accent-ink:#67e6df; --on-accent:#102927; --accent-wash:#153e46; }
  :root:not([data-theme="light"]).accent-violet { --accent:#a889ee; --accent-ink:#c4a9f3; --on-accent:#1f1438; --accent-wash:#302a50; }
  :root:not([data-theme="light"]).accent-rose   { --accent:#ee7288; --accent-ink:#ff9bad; --on-accent:#311018; --accent-wash:#482934; }
  :root:not([data-theme="light"]).accent-amber  { --accent:#f5b84f; --accent-ink:#ffd280; --on-accent:#1a1200; --accent-wash:#45341b; }
}
[data-theme="dark"].accent-cobalt,
[data-theme="dark"].accent-blue   { --accent:#3269dc; --accent-ink:#8db8ff; --on-accent:#fff; --accent-wash:#243b5c; }
[data-theme="dark"].accent-teal,
[data-theme="dark"].accent-green  { --accent:#45d6ce; --accent-ink:#67e6df; --on-accent:#102927; --accent-wash:#153e46; }
[data-theme="dark"].accent-violet { --accent:#a889ee; --accent-ink:#c4a9f3; --on-accent:#1f1438; --accent-wash:#302a50; }
[data-theme="dark"].accent-rose   { --accent:#ee7288; --accent-ink:#ff9bad; --on-accent:#311018; --accent-wash:#482934; }
[data-theme="dark"].accent-amber  { --accent:#f5b84f; --accent-ink:#ffd280; --on-accent:#1a1200; --accent-wash:#45341b; }

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-ink);
  text-decoration: none;
}
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- kaydırma çubuğu ----
   Hiç biçimlendirilmemişti: tarayıcı kendi açık gri çubuğunu çiziyordu ve koyu
   temada sayfanın kenarında parlak bir şerit gibi duruyordu. Renkler jetondan
   gelir, iki temada da doğru çalışır.

   `scrollbar-color` KALITILAN bir özelliktir; `html` üstünde tanımlamak
   içerideki bütün kaydırılabilir kutuları (paket listesi, yönetim tabloları,
   kenar çubuğu) kapsar. Webkit sözde öğeleri kalıtılmaz, o yüzden genel
   seçiciyle ayrıca veriliyor. */
html { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
/* Saydam kenarlık + content-box: başparmak kanallara yapışmaz, boşluklu durur. */
::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 8px;
  border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

.mono {
  font-family: var(--mono);
  font-size: .9em;
  /* Ligatür KAPALI: "--all" bitişik çizgiyi tek uzun tireye çeviriyordu ve
     ekrandan komut kopyalayan kişi "—all" yazıyordu. Adres, karma ve komut
     gösterdiğimiz her yerde harfler birebir görünmeli.
     `calt` (bağlama alternatifleri) ayrı bir özelliktir ve tek başına
     `font-variant-ligatures` onu kapatmaz; ikisi birden gerekiyor. Rakam
     hizası da buraya taşındı, çünkü `font-feature-settings`
     `font-variant-numeric`'i eziyor. */
  font-variant-ligatures: none;
  font-feature-settings: "tnum" 1, "liga" 0, "clig" 0, "calt" 0;
}

/* Marka adı TEK RENK: "Sell4Gamers" bütünüyle --ink. Rakam eskiden vurgu
   rengiyle boyanıyordu ama ad ikiye bölünmüş gibi duruyordu.

   Sarmalayıcı span duruyor (şablon filtresi `brandmark` üretir ve asıl işi
   adı kaçırmak); yalnızca rengi artık metinden ayrılmıyor. İleride rakamı
   yeniden vurgulamak istersen tek yer burası. */
.brand-4 { color: inherit; }

/* S4G halka logosu: köşe rozeti. Görsel app/web/static/brand/s4g-mark.png
   (1024'lük özgün logodan üretildi; sekme ikonları da aynı kaynaktan).
   Marka renkleri sabittir (sarı halka, mavi dilimler) — vurgu renginden
   türemez, her temada aynı görünür. */
.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .18));
}
.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---- basit kabuk (giriş, kurulum, hata sayfaları) ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 32px;
  background: transparent;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: none;
}
.topnav { display: flex; gap: 18px; align-items: center; }
.topnav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.topnav a:hover, .topnav a:focus-visible { color: var(--ink); text-decoration: none; }

.main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 72px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.footer {
  padding: 20px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  gap: 8px;
}
.footer .dot { opacity: .5; }

/* ---- kahraman (kurulum sayfası) ---- */
.eyebrow {
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.hero h1 {
  margin: 0;
  font-size: clamp(30px, 6vw, 42px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  text-wrap: balance;
}
.tagline { margin: 12px 0 0; font-size: 18px; color: var(--ink-2); }
.note { margin: 16px 0 0; max-width: 58ch; color: var(--muted); }

/* ---- panel ---- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-card);
}
.panel h2 {
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.status { margin: 0; display: grid; gap: 0; }
.status .row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
}
.status .row:first-child { border-top: none; }
.status dt { color: var(--muted); font-size: 14px; }
.status dd {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.status .detail { color: var(--muted); }

/* Durum hapları: yuvarlak, önünde nokta. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--ink-2);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.info { background: var(--info-bg); color: var(--info); }

.callout {
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 14px;
}

code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}

/* ---- düğmeler ---- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  padding: 0 18px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, background .15s, transform .12s;
}
.button:hover, .button:focus-visible { border-color: var(--accent); text-decoration: none; }
.button:active { transform: translateY(1px); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.button.primary:hover { filter: brightness(1.05); background: var(--accent); }
.button.primary:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.button.danger { border-color: var(--bad); color: var(--bad); background: none; }
.button.danger:hover { background: var(--bad-bg); }
button.button { margin-top: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 560px) {
  .status .row { grid-template-columns: 1fr; gap: 4px; }
  .main { padding: 36px 18px 56px; }
}

/* ================= kimlik, yönetim paneli ================= */

/* --- bildirimler ve bantlar --- */
.impersonation {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  flex-wrap: wrap; padding: 9px 20px; font-size: 14px;
  background: var(--warn-bg); color: var(--warn);
  border-bottom: 1px solid var(--line);
}
.flash {
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 6px;
  border: 1px solid var(--line); background: var(--surface); display: flex; gap: 10px;
  align-items: flex-start;
}
.flash::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor;
  flex: none; margin-top: 6px; }
.flash.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.flash.err { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.flash.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.flash a { color: inherit; text-decoration: underline; }

/* --- üst çubuk (basit kabuk) --- */
.topnav .who { color: var(--muted); font-size: 13px; }
.inline { display: inline; }
.link-button {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--muted); font: inherit; font-size: 14px; font-weight: 600;
}
.link-button:hover { color: var(--accent-ink); }

/* --- ortak --- */
.page-title { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.narrow { width: 100%; max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.narrow.wide { max-width: 640px; }
.lead { max-width: 62ch; color: var(--muted); margin: 6px 0 0; font-size: 14.5px; }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.pad { padding: 22px !important; }
.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key { font-size: 11.5px; opacity: .8; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px;
  box-shadow: var(--shadow-card);
}
.card > p:first-child { margin-top: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.card-head h2 {
  margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.01em; color: var(--ink);
}
.card-head .hint { margin: 0; }
/* Geniş tablolar kart içinde kaysın; sayfa gövdesi asla yana kaymaz. */
.card.flush { padding: 0; overflow-x: auto; }
.card.flush .card-head { padding: 18px 20px 0; margin-bottom: 8px; }
/* Needs attention: başlık + ipucu solda, "okundu" düğmesi sağda; okunmuş satırlar katlı ve soluk. */
.card.flush .card-head.att-head { padding: 14px 16px; align-items: center; }
.att-head .hint { margin-top: 4px; }
.att-head form { flex: none; }
.att-seen > summary { cursor: pointer; padding: 8px 16px 12px; list-style: none; }
.att-seen > summary::before { content: "▸ "; }
.att-seen[open] > summary::before { content: "▾ "; }
.att-dim { opacity: .6; }
.att-dim .pill { background: none; border-color: var(--line); color: var(--muted); }

/* --- formlar --- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.narrow-form { max-width: 360px; margin-top: 16px; }
label > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
label > span em { font-style: normal; color: var(--muted); font-size: 12.5px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=search],
input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 10px 13px; font: inherit; font-size: 14px;
  /* Elle doldurulan kutular karttan bir kademe KOYU: "içine yazılacak yer"
     hissi verir. Eskiden --surface-2 ile karttan açıktı; çerçeve zemine
     1.63:1 ile yapışıyor, kutunun sınırı seçilmiyordu. Şimdi 2.46:1. */
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
input:disabled, select:disabled, textarea:disabled { opacity: .6; cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; font-family: inherit; }
select { appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.code-input { font-family: var(--mono); font-size: 20px; letter-spacing: .3em; }
.hint { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.field-row {
  display: grid; grid-template-columns: 260px 1fr; gap: 24px;
  padding: 16px 0; border-top: 1px solid var(--line-soft);
}
.field-row:first-of-type { border-top: none; padding-top: 0; }
.field-label label { font-size: 14px; font-weight: 600; color: var(--ink); }
.field-label .hint { margin-top: 4px; }
.field-label .key { display: inline-block; margin-top: 8px; }
.field-input { max-width: 420px; }

.switch, .check { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; cursor: pointer; }
.switch input, .check input { margin-top: 3px; width: auto; accent-color: var(--accent); }
.check span { color: var(--ink-2); }
.check code { margin-left: 4px; }

.searchbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.searchbar input, .searchbar select { max-width: 320px; }
/* Anlık arama sürerken (live-search.js) kutu hafifçe soluk. */
form.is-searching input[type="search"] { opacity: .7; transition: opacity .15s; }

/* --- tablolar --- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 13px 18px 10px; font-size: 11px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.table td { padding: 12px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table a { color: var(--accent-ink); text-decoration: none; font-weight: 600; }
.table a:hover { text-decoration: underline; }
.table .mono { white-space: nowrap; }

.pager { display: flex; gap: 16px; align-items: center; font-size: 14px; }
.pager a { color: var(--accent-ink); font-weight: 600; }

/* --- yönetim paneli düzeni (eski basit kabuk) --- */
.main.main-wide { max-width: 1180px; padding-top: 36px; }
.admin { display: grid; grid-template-columns: 190px 1fr; gap: 36px; align-items: start; }
.sidebar { position: sticky; top: 24px; }
.sidebar-label {
  margin: 0 0 10px; font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  padding: 8px 12px; border-radius: 10px; font-size: 14px;
  color: var(--ink-2); text-decoration: none;
}
.sidebar nav a:hover { background: var(--surface); }
.sidebar nav a.active { background: var(--accent); color: var(--on-accent); font-weight: 600; }

.admin-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-card);
}
.tile-k { font-size: 12px; font-weight: 600; color: var(--muted); }
.tile-v { font-size: 25px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.perm-group { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.perm-group:first-of-type { border-top: none; padding-top: 0; }
.perm-group-title {
  margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
}
.perm-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }

.qr { max-width: 190px; margin: 16px 0; background: #fff; padding: 10px; border-radius: 12px; }
.qr svg { width: 100%; height: auto; display: block; }
.codes { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.codes li { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; text-align: center; letter-spacing: .06em; font-family: var(--mono); }
.recovery { margin-top: 18px; font-size: 14px; }
.recovery summary { cursor: pointer; color: var(--muted); }

@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; gap: 20px; }
  .sidebar { position: static; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .field-row { grid-template-columns: 1fr; gap: 8px; }
  .main { max-width: 100%; }
}

/* ================= katalog yönetimi ================= */

.thumb-cell { width: 52px; }
.thumb {
  width: 36px; height: 36px; object-fit: contain; display: block;
  border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2);
}
.thumb.empty { display: block; }
.preview-image {
  max-width: 160px; max-height: 110px; display: block; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
}

.movers { display: inline-flex; gap: 3px; }
.icon-button {
  width: 28px; height: 28px; line-height: 1; cursor: pointer;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 8px; font-size: 13px;
}
.icon-button:hover { border-color: var(--accent); color: var(--accent-ink); }

.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }

/* --- satır içi düzenlenebilir listeler --- */
.editable-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.editable {
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
}
.editable > summary {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; cursor: pointer; font-size: 14px; list-style: none;
}
.editable > summary::-webkit-details-marker { display: none; }
.editable > summary::before { content: "▸"; color: var(--muted); font-size: 11px; }
.editable[open] > summary::before { content: "▾"; }
.editable[open] > summary { border-bottom: 1px solid var(--line); }
.ed-name { font-weight: 600; }
.chip-amount {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 7px; font-size: 12px;
}

.ed-form { padding: 16px 14px; display: flex; flex-direction: column; gap: 14px; }
.ed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.ed-checks { display: flex; flex-direction: column; gap: 8px; }
.ed-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ed-actions .button { margin-top: 0; }

.add-row {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px solid var(--line-soft);
}
.add-row input[type=text], .add-row select, .add-row textarea { width: auto; min-width: 130px; flex: 1 1 130px; }
.add-row textarea { min-height: 38px; flex: 1 1 200px; }
.add-row .button { margin-top: 0; }
.add-row .check { flex: 0 0 auto; }

/* --- sipariş formu önizlemesi --- */
.order-preview {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 380px; padding: 20px; border-radius: var(--radius);
  background: var(--paper); border: 1px dashed var(--line);
}
.preview-title { margin: 0; font-size: 17px; font-weight: 700; }
.order-preview select, .order-preview input { background: var(--surface); }
.order-preview label > span em { text-transform: none; }

/* ================= fiyatlandırma ================= */

.table.plain { min-width: 0; }
.flat-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; font-size: 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
}
.flat-row .push { margin-left: auto; }

.chip-price {
  background: var(--ok-bg); color: var(--ok); border-radius: 6px;
  padding: 1px 7px; font-size: 12px; font-weight: 700;
}
.price-cell { font-weight: 700; }
.ok-text { color: var(--ok); }

.suffix-input { display: flex; align-items: center; gap: 8px; }
.suffix-input input { flex: 1; }
.suffix-input span { color: var(--muted); font-size: 14px; }

.tile .small { margin-top: -2px; }
.scroll-x { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }

/* ================= tedarikçi eşleştirme ================= */

.map-row { padding: 16px 0; border-top: 1px solid var(--line-soft); }
.map-row:first-of-type { border-top: none; padding-top: 0; }
.map-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.map-plan { margin: 8px 0 0; }
.map-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.map-list li {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; font-size: 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
}
.map-list .push { margin-left: auto; }
.map-row .add-row { border-top: none; padding-top: 10px; }
.map-row .add-row select { flex: 2 1 260px; }

/* ================= sipariş akışı ================= */

.product-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.product-img { width: 96px; height: 96px; object-fit: contain; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface-2); }

/* Paketler: ızgara kart. Seçili olanın çerçevesi turuncu, zemini aynı kalır. */
.pkg-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pkg-opt { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
  cursor: pointer; transition: border-color .15s, background .15s; }
.pkg-opt:hover { border-color: var(--accent); }
.pkg-opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent);
  background: var(--accent-wash); }
.pkg-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.pkg-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.pkg-name { font-size: 14.5px; font-weight: 700; line-height: 1.25; }
.pkg-price { font-weight: 600; color: var(--muted); font-size: 13px; }
.pkg-opt:has(input:checked) .pkg-price { color: var(--accent-ink); }
.pkg-tick { position: absolute; right: 10px; top: 10px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); display: grid; place-items: center;
  opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; }
.pkg-tick svg { width: 11px; height: 11px; }
.pkg-opt:has(input:checked) .pkg-tick { opacity: 1; transform: none; }
.wide-btn { width: 100%; margin-top: 14px; }

.total { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; font-size: 14px;
  border-top: 1px solid var(--line-soft); }
.total.big { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.total.big b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.balance-big { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }

.pos { color: var(--ok); font-weight: 700; }
.neg { color: var(--bad); }

/* --- zaman çizgisi --- */
.tl { display: grid; gap: 0; }
.tl-row { display: grid; grid-template-columns: 16px 1fr; gap: 12px;
  padding-bottom: 14px; position: relative; }
.tl-row:not(:last-child)::before { content: ""; position: absolute; left: 7px; top: 16px;
  bottom: 0; width: 1px; background: var(--line); }
.tl-dot { width: 15px; height: 15px; border-radius: 50%; background: var(--surface);
  border: 2px solid var(--ok); margin-top: 1px; z-index: 1; }
.tl-row.fail .tl-dot { border-color: var(--bad); }
.tl-t { display: block; font-size: 14px; font-weight: 600; }
.tl-m { display: block; font-size: 12.5px; color: var(--muted); }

.code-box { background: var(--surface-2); border: 1px dashed var(--accent); border-radius: var(--radius-sm);
  padding: 14px; text-align: center; font-family: var(--mono);
  font-size: 17px; letter-spacing: .12em; color: var(--accent-ink); font-weight: 600;
  margin-bottom: 8px; word-break: break-all; }

/* --- onay kutusu satırı (sözleşme onayı gibi) --- */
.check { display: flex; gap: 9px; align-items: flex-start; margin: 4px 0 14px;
  font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.check input { margin-top: 3px; flex: none; }
