/* ===========================================================================
   Takyk Terjime — web arayüzü
   Tasarım yönü: "Telegram sohbeti + resmi belge masası".
   Akış konuşma gibi ilerler (aynı Telegram botundaki gibi), ama yüzey dili
   evrak/mühür dünyasından: kağıt dokusu, mürekkep laciverti, tüy kalem teali.
   Renkler logodan türetildi (tüy kalem gradyanı: derin mavi → turkuaz).
   =========================================================================== */

:root {
  color-scheme: light dark;

  /* Marka çekirdeği (temadan bağımsız) */
  --brand-ink: #163d5c;
  --brand-deep: #1f5c8b;
  --brand-mid: #2f86a8;
  --brand-teal: #3fa9a5;
  --brand-glow: #5fd0c8;
  --brand-grad: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand-mid) 48%, var(--brand-teal) 100%);

  /* Aydınlık tema */
  --bg: #eef2f5;
  --bg-deep: #e2e9ee;
  --surface: #ffffff;
  --surface-2: #f5f8fa;
  --surface-sunk: #e8eef2;
  --bubble-in: #ffffff;
  --bubble-out: linear-gradient(135deg, #1f5c8b, #35939f);
  --bubble-out-text: #ffffff;
  --text: #10222f;
  --text-dim: #5b7183;
  --text-faint: #8a9cab;
  --line: #d8e2e9;
  --line-soft: #e7eef2;
  --accent: #17798f;
  --ok: #1f9d76;
  --warn: #b6791f;
  --err: #c34a45;
  --err-bg: #fdeceb;
  --shadow-sm: 0 1px 2px rgba(16, 34, 47, .06), 0 2px 8px rgba(16, 34, 47, .05);
  --shadow-md: 0 4px 14px rgba(16, 34, 47, .09), 0 18px 40px -20px rgba(16, 34, 47, .28);
  --shadow-lg: 0 24px 70px -28px rgba(12, 40, 60, .45);
  --wall-a: rgba(63, 169, 165, .10);
  --wall-b: rgba(31, 92, 139, .09);
  --wall-line: rgba(31, 92, 139, .045);

  /* Ritim & hareket */
  --r-bubble: 18px;
  --r-card: 16px;
  --r-pill: 999px;
  --dur-fast: 140ms;
  --dur: 260ms;
  --spring: cubic-bezier(.18, .89, .32, 1.24);
  --ease: cubic-bezier(.22, 1, .36, 1);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c151d;
    --bg-deep: #080f15;
    --surface: #14212c;
    --surface-2: #1a2a37;
    --surface-sunk: #101b24;
    --bubble-in: #1a2a37;
    --bubble-out: linear-gradient(135deg, #1d5a86, #2f8f92);
    --bubble-out-text: #f2fbfb;
    --text: #e6eef4;
    --text-dim: #94a9b9;
    --text-faint: #6a8093;
    --line: #24384a;
    --line-soft: #1d2d3b;
    --accent: #58c3cf;
    --ok: #3ec49a;
    --warn: #d9a94f;
    --err: #ef7b74;
    --err-bg: #35201f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, .45);
    --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, .8);
    --wall-a: rgba(63, 169, 165, .12);
    --wall-b: rgba(31, 92, 139, .16);
    --wall-line: rgba(120, 190, 210, .04);
  }
}

:root[data-theme="dark"] {
  --bg: #0c151d;
  --bg-deep: #080f15;
  --surface: #14212c;
  --surface-2: #1a2a37;
  --surface-sunk: #101b24;
  --bubble-in: #1a2a37;
  --bubble-out: linear-gradient(135deg, #1d5a86, #2f8f92);
  --bubble-out-text: #f2fbfb;
  --text: #e6eef4;
  --text-dim: #94a9b9;
  --text-faint: #6a8093;
  --line: #24384a;
  --line-soft: #1d2d3b;
  --accent: #58c3cf;
  --ok: #3ec49a;
  --warn: #d9a94f;
  --err: #ef7b74;
  --err-bg: #35201f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, .45);
  --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, .8);
  --wall-a: rgba(63, 169, 165, .12);
  --wall-b: rgba(31, 92, 139, .16);
  --wall-line: rgba(120, 190, 210, .04);
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur: 0ms; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

* { box-sizing: border-box; }

/* display:flex/grid kurallari tarayicinin [hidden] varsayilanini eziyordu:
   gizlenmesi gereken bolumler (gate/app/composer-actions) gorunur kaliyordu. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }

/* --- "Duvar kağıdı": Telegram sohbet zemininin evrak yorumu ---------------- */
.wallpaper {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 600px at 12% -8%, var(--wall-a), transparent 62%),
    radial-gradient(900px 520px at 92% 8%, var(--wall-b), transparent 60%),
    repeating-linear-gradient(0deg, var(--wall-line) 0 1px, transparent 1px 26px),
    var(--bg);
}

/* ===========================  GİRİŞ EKRANI  =============================== */
.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 18px 40px;
}

.gate-card {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 30px 28px 26px;
  animation: rise var(--dur) var(--spring) both;
}

.gate-brand { text-align: center; margin-bottom: 22px; }
.gate-brand img { width: 74px; height: 74px; object-fit: contain; }
.gate-brand h1 {
  margin: 10px 0 2px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.gate-brand p { margin: 0; color: var(--text-dim); font-size: 13.5px; }

.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-sunk);
  padding: 4px;
  border-radius: var(--r-pill);
  margin-bottom: 20px;
}
.tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 9px 10px;
  border-radius: var(--r-pill);
  font-weight: 650;
  font-size: 14px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast);
}
.tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.field { margin-bottom: 13px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-dim);
  margin-bottom: 5px;
  letter-spacing: .01em;
}
.field input {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast);
}
.field input:focus {
  outline: 0;
  border-color: var(--brand-mid);
  background: var(--surface);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--brand-mid) 18%, transparent);
}
.hint { font-size: 12px; color: var(--text-faint); margin-top: 5px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  padding: 11px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14.5px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  transition: transform var(--dur-fast) var(--ease), filter var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--brand-grad);
  color: #fff;
  border: 0;
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--brand-mid) 80%, transparent);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, transparent); background: transparent; }
.btn-ok { color: #fff; background: var(--ok); border: 0; }

.alert {
  padding: 10px 13px;
  border-radius: 11px;
  font-size: 13.5px;
  margin-bottom: 13px;
  border: 1px solid transparent;
  animation: rise var(--dur-fast) var(--ease) both;
}
.alert-err { background: var(--err-bg); color: var(--err); border-color: color-mix(in srgb, var(--err) 30%, transparent); }
.alert-ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.alert-info { background: var(--surface-sunk); color: var(--text-dim); border-color: var(--line); }

/* =========================  SOHBET KABUĞU  ================================ */
.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 780px;
  margin: 0 auto;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  border-inline: 1px solid var(--line-soft);
  backdrop-filter: blur(2px);
}

/* Telegram üst çubuğu: avatar + başlık + durum */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .avatar { width: 40px; height: 40px; flex: 0 0 auto; }
.topbar-txt { min-width: 0; flex: 1; }
.topbar-txt strong { display: block; font-size: 15.5px; font-weight: 750; letter-spacing: -.01em; }
.topbar-txt span { display: block; font-size: 12.5px; color: var(--text-dim); }
.topbar-txt span.live { color: var(--ok); }
.topbar-actions { display: flex; gap: 2px; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0; background: transparent;
  border-radius: 50%;
  color: var(--text-dim);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-sunk); color: var(--text); }
.icon-btn:active { transform: scale(.9); }
.icon-btn svg { width: 20px; height: 20px; }

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.avatar img { width: 82%; height: 82%; object-fit: contain; }

/* --- Mesaj akışı ---------------------------------------------------------- */
.thread {
  flex: 1;
  padding: 18px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-anchor: none;
}

.day-sep {
  align-self: center;
  margin: 6px 0 12px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-dim);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  animation: rise var(--dur) var(--ease) both;
}

.msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 9px;
  animation: bubble-in var(--dur) var(--spring) both;
}
.msg.out { flex-direction: row-reverse; }
.msg + .msg.same { margin-top: 2px; }
.msg.same .avatar { visibility: hidden; }

.bubble {
  position: relative;
  max-width: min(78%, 520px);
  padding: 9px 13px 8px;
  border-radius: var(--r-bubble);
  background: var(--bubble-in);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line-soft);
  font-size: 14.5px;
  word-break: break-word;
}
.msg.in .bubble { border-bottom-left-radius: 6px; }
.msg.out .bubble {
  background: var(--bubble-out);
  color: var(--bubble-out-text);
  border: 0;
  border-bottom-right-radius: 6px;
}
.msg.in .bubble::after {
  content: "";
  position: absolute;
  left: -6px; bottom: -1px;
  width: 12px; height: 14px;
  background: var(--bubble-in);
  border-left: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  border-bottom-left-radius: 12px 10px;
  clip-path: polygon(0 100%, 100% 100%, 100% 0);
}
.msg.same.in .bubble::after { display: none; }
.msg.same.in .bubble { border-bottom-left-radius: var(--r-bubble); }

.bubble p { margin: 0 0 6px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble b { font-weight: 720; }
.bubble .meta {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-faint);
}
.msg.out .bubble .meta { color: rgba(255, 255, 255, .72); }

/* "yazıyor…" — Telegram'ın üç noktası */
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; align-items: center; }
.typing i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-faint);
  animation: blink 1.25s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }

/* --- Inline klavye (Telegram butonları) ----------------------------------- */
.keyboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 6px;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
}
.kb-btn {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--accent);
  border-radius: 11px;
  padding: 10px 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.kb-btn:hover { background: var(--brand-grad); color: #fff; border-color: transparent; transform: translateY(-1px); }
.kb-btn:active { transform: scale(.96); }
.kb-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.kb-btn small { display: block; font-weight: 500; font-size: 11px; opacity: .75; }

/* --- Belge kartı (sınıflandırma sonucu) ----------------------------------- */
.doccard {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 9px 0;
}
.doccard + .doccard { border-top: 1px solid var(--line-soft); }
.doc-icon {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--brand-teal) 14%, transparent);
  color: var(--accent);
}
.doc-icon svg { width: 21px; height: 21px; }
.doc-icon.state-done { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.doc-icon.state-error { background: var(--err-bg); color: var(--err); }
.doc-body { min-width: 0; flex: 1; }
.doc-title {
  font-weight: 700;
  font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.doc-sub { font-size: 12.5px; color: var(--text-dim); }
.doc-sub .sep { opacity: .45; margin: 0 5px; }
.doc-err { font-size: 12.5px; color: var(--err); margin-top: 2px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 700;
  background: var(--surface-sunk);
  color: var(--text-dim);
  border: 1px solid var(--line-soft);
}
.chip.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); border-color: transparent; }
.chip.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); border-color: transparent; }
.chip.err { background: var(--err-bg); color: var(--err); border-color: transparent; }

.type-select {
  margin-top: 5px;
  width: 100%;
  max-width: 320px;
  padding: 6px 9px;
  font-size: 12.5px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  background: var(--surface-2);
}
.type-select:focus { outline: 0; border-color: var(--brand-mid); }

/* İlerleme çizgisi — belge işlenirken */
.progress {
  height: 3px;
  border-radius: 3px;
  background: var(--surface-sunk);
  overflow: hidden;
  margin-top: 7px;
}
.progress i {
  display: block; height: 100%; width: 40%;
  background: var(--brand-grad);
  border-radius: 3px;
  animation: slide 1.15s infinite var(--ease);
}

/* İndirme balonu */
.filecard {
  display: flex; align-items: center; gap: 11px;
  text-decoration: none; color: inherit;
  padding: 3px 0;
}
.filecard .dl {
  flex: 0 0 auto; width: 42px; height: 42px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-grad);
  color: #fff;
  transition: transform var(--dur-fast) var(--ease);
}
.filecard:hover .dl { transform: scale(1.08); }
.filecard .dl svg { width: 20px; height: 20px; }
.filecard .doc-title, .filecard .doc-sub { display: block; }

/* --- Giriş çubuğu (Telegram) ------------------------------------------- */
.composer {
  position: sticky;
  bottom: 0;
  z-index: 20;
  padding: 8px 12px calc(9px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
}

.inputbar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 24px;
  padding: 4px 5px 4px 4px;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.inputbar:focus-within {
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--brand-mid) 15%, transparent);
}
.inputbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 9px 4px;
  font-size: 15px;
}
.inputbar input:focus { outline: 0; }
.inputbar input::placeholder { color: var(--text-faint); }

.sendbtn {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-grad);
  color: #fff;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), filter var(--dur-fast), opacity var(--dur-fast);
}
.sendbtn svg { width: 19px; height: 19px; margin-left: -1px; }
.sendbtn:hover { filter: brightness(1.08); }
.sendbtn:active { transform: scale(.9); }
.sendbtn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* Ataç düğmesi dosya varken vurgulanır */
#btn-attach.has-files { color: var(--accent); background: color-mix(in srgb, var(--brand-teal) 16%, transparent); }

.queue { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.queue:empty { display: none; }
.queue-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 6px 5px 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 12.5px;
  max-width: 240px;
  animation: rise var(--dur-fast) var(--spring) both;
}
.queue-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item button {
  border: 0; background: transparent; cursor: pointer;
  width: 20px; height: 20px; border-radius: 50%;
  color: var(--text-faint); display: grid; place-items: center; font-size: 12px;
}
.queue-item button:hover { background: var(--err-bg); color: var(--err); }

/* --- Komut menüsü (Telegram'ın "/" listesi) ----------------------------- */
.cmdmenu {
  margin-bottom: 8px;
  max-height: 46vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 5px;
  animation: rise var(--dur-fast) var(--ease) both;
}
.cmdmenu button {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 9px 11px;
  border-radius: 11px;
  cursor: pointer;
  transition: background var(--dur-fast);
}
.cmdmenu button:hover, .cmdmenu button.active { background: var(--surface-sunk); }
.cmdmenu button b {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  flex: 0 0 auto;
  min-width: 84px;
}
.cmdmenu button span { color: var(--text-dim); font-size: 13px; }
.cmdmenu .empty { padding: 14px; }

/* --- Sürükle-bırak katmanı ---------------------------------------------- */
.dropveil {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--bg-deep) 78%, transparent);
  backdrop-filter: blur(3px);
  animation: fade var(--dur-fast) ease both;
}
.dropveil-box {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 40px 56px;
  border: 2px dashed var(--brand-teal);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: rise var(--dur) var(--spring) both;
}
.dropveil-box svg { width: 40px; height: 40px; color: var(--accent); }
.dropveil-box strong { font-size: 16px; }
.dropveil-box span { font-size: 13px; color: var(--text-dim); }

/* --- Modal ---------------------------------------------------------------- */
.modal-back {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(8, 20, 28, .55);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fade var(--dur-fast) ease both;
}
.modal {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 24px 22px 20px;
  animation: rise var(--dur) var(--spring) both;
}
.modal h2 { margin: 0 0 4px; font-size: 18px; letter-spacing: -.01em; }
.modal p.sub { margin: 0 0 16px; color: var(--text-dim); font-size: 13.5px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* --- Animasyonlar --------------------------------------------------------- */
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(14px) scale(.94); }
  to { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink {
  0%, 60%, 100% { opacity: .28; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
@keyframes slide {
  0% { transform: translateX(-105%); }
  100% { transform: translateX(320%); }
}

/* =============================  YÖNETİM  ================================== */
.admin { max-width: 1040px; margin: 0 auto; padding: 0 18px 60px; }
.admin-top {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.admin-top h1 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.admin-top .grow { flex: 1; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 15px 16px;
  box-shadow: var(--shadow-sm);
  animation: rise var(--dur) var(--spring) both;
}
.stat b { display: block; font-size: 27px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--text-dim); }
.stat.hot b { color: var(--warn); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
  overflow: hidden;
}
.panel > h2 {
  margin: 0;
  padding: 14px 18px;
  font-size: 15px;
  letter-spacing: -.01em;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 9px;
}
.panel-body { padding: 16px 18px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-faint); font-weight: 700;
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
}
td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--dur-fast); }
tbody tr:hover { background: var(--surface-2); }
td .mail { font-weight: 650; }
td .sub { font-size: 12px; color: var(--text-dim); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

.empty { padding: 26px 18px; text-align: center; color: var(--text-faint); font-size: 13.5px; }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { margin: 0; flex: 1 1 190px; }

.codebox {
  font-family: var(--font-num);
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  user-select: all;
  word-break: break-all;
}

.log { font-size: 12.5px; color: var(--text-dim); font-family: var(--font-num); }
.log li { padding: 4px 0; border-bottom: 1px solid var(--line-soft); list-style: none; }
.log ul { margin: 0; padding: 0; }

@media (max-width: 640px) {
  .shell { border: 0; }
  .bubble { max-width: 86%; }
  .admin-top h1 { font-size: 17px; }
  th:nth-child(3), td:nth-child(3) { display: none; }
}
