/* Tuzkaya Yönetim Paneli — tasarım sistemi */
:root {
  --navy: #0b2a66;
  --navy-2: #0a1f4d;
  --blue: #2e6bff;
  --blue-ink: #1e4fd6;
  --accent: #ffb020;
  --bg: #f4f7fc;
  --card: #ffffff;
  --ink: #0f1b33;
  --muted: #5b6a86;
  --line: #e4e9f2;
  --line-2: #eef2f8;
  --ok: #14894a;
  --ok-bg: #e5f5ec;
  --err: #d13b3b;
  --err-bg: #fceaea;
  --warn: #b7791f;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 27, 51, 0.06), 0 6px 24px rgba(16, 27, 51, 0.06);
  --shadow-lg: 0 12px 40px rgba(16, 27, 51, 0.16);
  --sidebar-w: 248px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-ink); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
button { font-family: inherit; }

/* ---------- Yardımcı ---------- */
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: grid; gap: 14px; }

/* ---------- Butonlar ---------- */
.btn {
  appearance: none;
  border: 1px solid transparent;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: filter .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { filter: brightness(.96); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--line-2); filter: none; }
.btn--subtle { background: var(--line-2); color: var(--ink); }
.btn--subtle:hover { background: #e2e8f4; filter: none; }
.btn--danger { background: #fff; color: var(--err); border-color: #f0cccc; }
.btn--danger:hover { background: var(--err-bg); filter: none; }
.btn--accent { background: var(--accent); color: #3a2a00; }
.btn--sm { padding: 6px 11px; font-size: 13px; }
.btn--block { width: 100%; justify-content: center; }
.iconbtn {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.iconbtn:hover { background: var(--line-2); color: var(--ink); }
.iconbtn--danger:hover { background: var(--err-bg); color: var(--err); border-color: #f0cccc; }

/* ---------- Giriş ekranı ---------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 500px at 20% -10%, rgba(46,107,255,.25), transparent 60%),
    linear-gradient(160deg, var(--navy), var(--navy-2));
  padding: 20px;
}
.login__card {
  background: #fff;
  width: min(400px, 100%);
  border-radius: 18px;
  padding: 34px 30px;
  box-shadow: var(--shadow-lg);
}
.login__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brandmark {
  width: 42px; height: 42px; border-radius: 11px;
  background: linear-gradient(145deg, var(--blue), var(--navy));
  color: #fff; font-weight: 800; font-size: 20px;
  display: grid; place-items: center; position: relative; flex: none;
}
.brandmark::after {
  content: ""; position: absolute; top: 7px; right: 7px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
}
.login h1 { font-size: 20px; }
.login .muted { font-size: 13px; }

/* ---------- Form alanları ---------- */
.field { display: grid; gap: 6px; }
.field > label, .lbl {
  font-size: 13px; font-weight: 600; color: #33415c;
}
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
input[type=text], input[type=tel], input[type=email], input[type=url],
input[type=password], input[type=number], input[type=date], input[type=datetime-local],
select, textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 74px; }
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46,107,255,.14);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Uygulama kabuğu ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--navy), var(--navy-2));
  color: #cdd8f0;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; }
.sidebar__brand b { color: #fff; font-size: 15px; line-height: 1.2; }
.sidebar__brand span { display: block; font-size: 11.5px; color: #8fa6d8; }
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px;
  color: #c3d0ec; text-decoration: none; font-weight: 500; font-size: 14px;
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
}
.nav-link svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.active { background: rgba(46,107,255,.28); color: #fff; }
.nav-link .badge {
  margin-left: auto; background: var(--accent); color: #3a2a00;
  font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 8px;
}
.sidebar__foot { margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.1); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 26px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 19px; }
.topbar .sub { font-size: 12.5px; color: var(--muted); }
.burger { display: none; }
.content { padding: 24px 26px 60px; max-width: 1080px; width: 100%; }

/* ---------- Kart ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card__head h2 { font-size: 16px; }
.card__head .muted { font-size: 12.5px; }

/* ---------- Pano istatistikleri ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 820px){ .stats { grid-template-columns: repeat(2,1fr);} }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat .n { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 2px; }
.stat.hot .n { color: var(--blue-ink); }

/* ---------- Liste öğeleri (kurs/blog) ---------- */
.list { display: grid; gap: 10px; }
.item {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px;
}
.item__thumb {
  width: 54px; height: 54px; border-radius: 9px; object-fit: cover;
  background: var(--line-2); flex: none;
}
.item__body { min-width: 0; flex: 1; }
.item__body b { font-size: 14.5px; display: block; }
.item__body .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip {
  display: inline-block; font-size: 11.5px; font-weight: 600;
  background: var(--line-2); color: #48577a; border-radius: 999px; padding: 2px 9px;
}

/* ---------- Form mesajı kartı ---------- */
.msg {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  border-left: 4px solid transparent;
}
.msg.unread { border-left-color: var(--blue); background: #fbfcff; }
.msg__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.msg__top b { font-size: 15px; }
.msg__time { font-size: 12px; color: var(--muted); margin-left: auto; }
.msg__grid { display: flex; gap: 18px; flex-wrap: wrap; margin: 8px 0; font-size: 13.5px; }
.msg__grid span b { color: #33415c; }
.msg__text { font-size: 14px; background: var(--line-2); border-radius: 9px; padding: 9px 12px; margin-top: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex: none; }

/* ---------- Tekrarlı alan blokları (dizi editörü) ---------- */
.rep { display: grid; gap: 12px; }
.rep__item {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  background: #fbfcfe; position: relative;
}
.rep__item .rep__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.rep__item .rep__head .idx { font-size: 12px; font-weight: 700; color: var(--muted); }
.rep__handle { cursor: default; color: #b6c0d4; }

/* ---------- Modal / editör paneli ---------- */
.drawer-scrim {
  position: fixed; inset: 0; background: rgba(10,20,45,.42);
  display: flex; justify-content: flex-end; z-index: 40;
}
.drawer {
  background: var(--bg); width: min(760px, 100%); height: 100%;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.drawer__head {
  position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--line);
  padding: 16px 22px; display: flex; align-items: center; gap: 12px; z-index: 2;
}
.drawer__head h2 { font-size: 17px; }
.drawer__body { padding: 20px 22px; display: grid; gap: 16px; }
.drawer__foot {
  position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line);
  padding: 14px 22px; display: flex; gap: 10px; justify-content: flex-end;
}

/* ---------- Sekmeler ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  border: none; background: none; padding: 9px 14px; cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--blue-ink); border-bottom-color: var(--blue); }

/* ---------- Görsel seçici ---------- */
.imgpick { display: flex; gap: 12px; align-items: flex-start; }
.imgpick__preview {
  width: 96px; height: 72px; border-radius: 9px; object-fit: cover;
  border: 1px solid var(--line); background: var(--line-2); flex: none;
}

/* ---------- Toast ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 10px; z-index: 80; }
.toast {
  background: #16223d; color: #fff; padding: 12px 16px; border-radius: 11px;
  box-shadow: var(--shadow-lg); font-size: 14px; display: flex; align-items: center; gap: 10px;
  animation: toastin .2s ease;
}
.toast.ok { background: #12683d; }
.toast.err { background: #a52d2d; }
@keyframes toastin { from { opacity: 0; transform: translateY(8px);} to {opacity:1;transform:none;} }

/* ---------- Boş durum ---------- */
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty svg { width: 40px; height: 40px; opacity: .4; }

/* ---------- Yükleniyor ---------- */
.spin { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg);} }
.center-load { display: grid; place-items: center; padding: 60px; color: var(--muted); }

/* ---------- Duyarlı ---------- */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 60; width: 260px;
    transform: translateX(-100%); transition: transform .2s;
  }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open::after {
    content: ""; position: fixed; inset: 0; background: rgba(10,20,45,.4); z-index: 55;
  }
  .burger { display: inline-grid; }
}
