/* ==========================================================================
   Takaslayın Yönetim Paneli — Tasarım Sistemi (global.css)
   Tek kaynak: renk, tipografi, boşluk, bileşenler. Tüm panel bunu izler.
   ========================================================================== */
:root {
  /* Marka + nötr palet */
  --orange: #f97316;
  --orange-deep: #ea580c;
  --teal: #0d9488;
  --teal-deep: #0f766e;
  --gold: #d4a017;

  --ink: #0b1120;
  --ink-2: #111a2e;
  --ink-3: #1b2740;

  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e6eaf1;
  --line-2: #d8deea;

  --text: #131a27;
  --text-2: #5a6675;
  --text-3: #8b95a6;
  --on-dark: #eef2f8;
  --on-dark-2: #9aa6ba;

  --good: #10b981; --good-soft: #d1fae5;
  --warn: #f59e0b; --warn-soft: #fef3c7;
  --bad: #ef4444;  --bad-soft: #fee2e2;
  --info: #3b82f6; --info-soft: #dbeafe;
  --violet:#8b5cf6; --violet-soft:#ede9fe;

  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-pill: 999px;
  --sh-sm: 0 1px 2px rgba(17,26,46,.05), 0 2px 6px rgba(17,26,46,.05);
  --sh: 0 4px 14px rgba(17,26,46,.07), 0 12px 34px rgba(17,26,46,.08);
  --sidebar: 250px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.hidden { display: none !important; }

/* ---------- Tipografi yardımcıları ---------- */
.h1 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.h2 { font-size: 17px; font-weight: 700; }
.muted { color: var(--text-2); }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-3); }
.mono { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Giriş ekranı
   ========================================================================== */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(700px 400px at 15% 0%, rgba(249,115,22,.14), transparent 60%),
    radial-gradient(700px 400px at 100% 100%, rgba(13,148,136,.14), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh); padding: 32px 28px;
}
.login-card .brand { display: flex; justify-content: center; margin-bottom: 18px; }
.login-card .wordmark { height: 42px; width: auto; }
.login-title { font-size: 18px; font-weight: 800; text-align: center; }
.login-sub { font-size: 13px; color: var(--text-2); text-align: center; margin: 4px 0 22px; }

/* ==========================================================================
   Uygulama iskeleti: sidebar + main
   ========================================================================== */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--ink); color: var(--on-dark);
  display: flex; flex-direction: column; padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; padding: 6px 10px 22px; }
.sidebar .brand .wordmark { height: 30px; width: auto; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.nav button {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 11px 12px; border: 0; background: transparent; color: var(--on-dark-2);
  border-radius: var(--r-sm); font-size: 14px; font-weight: 500; text-align: left;
  transition: background .15s, color .15s;
}
.nav button svg { width: 18px; height: 18px; flex: none; }
.nav button:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav button.active { background: rgba(249,115,22,.16); color: #fff; }
.nav button.active svg { color: var(--orange); }
.sidebar .foot { margin-top: auto; }
.sidebar .foot button {
  width: 100%; padding: 11px 12px; border: 1px solid rgba(255,255,255,.12);
  background: transparent; color: var(--on-dark-2); border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600;
}
.sidebar .foot button:hover { color: #fff; border-color: rgba(255,255,255,.25); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 64px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 10;
}
.topbar .who { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.topbar .who .av {
  width: 32px; height: 32px; border-radius: var(--r-pill); display: grid; place-items: center;
  background: linear-gradient(135deg, var(--orange), var(--teal)); color: #fff; font-weight: 800; font-size: 13px;
}
.content { padding: 26px 34px; width: 100%; }

/* ==========================================================================
   Bileşenler
   ========================================================================== */
/* Butonlar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--r-sm); border: 1px solid transparent;
  font-size: 14px; font-weight: 600; transition: transform .12s, box-shadow .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 6px 16px rgba(249,115,22,.3); }
.btn-primary:hover { background: var(--orange-deep); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--bad-soft); color: #b91c1c; }
.btn-danger:hover { background: #fecaca; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: default; }

/* Inputlar */
.field { display: block; margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.input {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line-2);
  border-radius: var(--r-sm); background: var(--surface); font-size: 14px; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(249,115,22,.14); }
.search { max-width: 320px; height: 40px; }

/* Kartlar */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}
.card-pad { padding: 20px; }

/* İstatistik kartları */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; box-shadow: var(--sh-sm); position: relative; overflow: hidden;
}
.stat .ic {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 12px;
}
.stat .ic svg { width: 20px; height: 20px; }
.stat .k { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .v { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.ic-o { background: #fff1e8; color: var(--orange-deep); }
.ic-t { background: #dcf5f1; color: var(--teal-deep); }
.ic-b { background: var(--info-soft); color: #1d4ed8; }
.ic-v { background: var(--violet-soft); color: #6d28d9; }
.ic-g { background: #fbf1d0; color: #a16207; }

/* Bölüm başlığı */
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px;
}
.section-head .h1 { display: flex; align-items: center; gap: 10px; }

/* Tablo */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-3); padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2);
  white-space: nowrap;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td .primary { font-weight: 600; color: var(--text); }
td .sub { font-size: 12px; color: var(--text-3); }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn { margin-left: 6px; }

/* Rozetler */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.b-good { background: var(--good-soft); color: #047857; }
.b-warn { background: var(--warn-soft); color: #b45309; }
.b-bad  { background: var(--bad-soft);  color: #b91c1c; }
.b-info { background: var(--info-soft); color: #1d4ed8; }
.b-gold { background: #fbf1d0; color: #a16207; }
.b-mut  { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }

/* Boş durum / yükleniyor */
.empty { text-align: center; padding: 40px 20px; color: var(--text-3); font-size: 14px; }
.spinner {
  width: 22px; height: 22px; border: 2.5px solid var(--line-2); border-top-color: var(--orange);
  border-radius: 50%; animation: spin .7s linear infinite; margin: 30px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r); font-size: 13.5px;
  box-shadow: var(--sh); display: flex; align-items: center; gap: 10px; animation: rise .25s ease;
  max-width: 340px;
}
.toast.err { background: #7f1d1d; }
.toast.ok  { background: #065f46; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* Hata satırı (login) */
.err-line { color: #b91c1c; font-size: 13px; margin-top: 4px; min-height: 18px; }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .sidebar .brand { padding: 4px 8px; }
  .nav { flex-direction: row; margin: 0 0 0 8px; }
  .sidebar .foot { margin: 0 0 0 auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
