/* Annelik Admin — tasarım (uygulama paletiyle uyumlu, mat & yumuşak) */
:root {
  --primary: #5E86C9;
  --primary-dark: #37559C;
  --primary-light: #E6EDF9;
  --primary-soft: #F2F6FC;
  --accent: #E58AA4;
  --accent-dark: #C25E7C;
  --green: #5FA07E;
  --green-light: #E6F3EC;
  --red: #E15B7B;
  --red-light: #FBE9EE;
  --warn: #C98A2E;
  --warn-light: #FBF1E0;
  --bg: #F5F8FD;
  --surface: #FFFFFF;
  --surface-alt: #EEF3FA;
  --text: #2E3A4D;
  --muted: #6C7789;
  --label: #9AA3B2;
  --border: #E4EAF2;
  --shadow: 0 6px 20px rgba(46, 58, 77, 0.06);
  --shadow-sm: 0 2px 8px rgba(46, 58, 77, 0.05);
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ---- Layout ---- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px 20px; }
.brand-name { font-size: 22px; font-weight: 800; color: var(--primary-dark); letter-spacing: .3px; }
.brand-tag { font-size: 12px; color: var(--label); font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px;
  color: var(--muted); font-weight: 600; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--primary-soft); color: var(--primary-dark); }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.nav-ico { font-size: 16px; width: 20px; text-align: center; }

.sidebar-foot { border-top: 1px solid var(--border); padding-top: 14px; }
.admin-mini { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 0 4px; }
.admin-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.admin-info { min-width: 0; }
.admin-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-mail { font-size: 11px; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; min-width: 0; }
.topbar {
  padding: 22px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 14px;
}
.topbar h1 { margin: 0; font-size: 20px; font-weight: 800; color: var(--text); }
.content { padding: 28px 32px; max-width: 1200px; }

/* Mobil menü tetikleyicileri (masaüstünde gizli) */
.hamburger { display: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--primary-dark); padding: 4px 6px; border-radius: 8px; user-select: none; }
.hamburger:hover { background: var(--surface-alt); }
.nav-backdrop { display: none; }

/* ---- Stat cards ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card {
  background: var(--surface); border-radius: var(--radius); padding: 20px;
  display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.stat-card.tone-green { border-left-color: var(--green); }
.stat-card.tone-pink { border-left-color: var(--accent); }
.stat-card.tone-red { border-left-color: var(--red); }
.stat-ico { font-size: 26px; width: 50px; height: 50px; border-radius: 14px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; }
.stat-val { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---- Panel ---- */
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 800; color: var(--text); }
.count { font-size: 12px; color: var(--muted); background: var(--surface-alt); padding: 2px 9px; border-radius: 20px; margin-left: 6px; font-weight: 700; }
.hint { color: var(--muted); font-size: 13px; margin: -4px 0 14px; }

/* ---- Table ---- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--label); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--primary-soft); }
.strong { font-weight: 700; color: var(--text); }
.muted { color: var(--muted); font-size: 13px; }
.empty { text-align: center; color: var(--label); padding: 28px 0; }
.link { color: var(--primary); font-weight: 600; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: var(--surface-alt); }
.thumb-empty { display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }

/* ---- Tags ---- */
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; margin-right: 3px; }
.tag-blue { background: var(--primary-light); color: var(--primary-dark); }
.tag-green { background: var(--green-light); color: var(--green); }
.tag-pink { background: #FBEAF0; color: var(--accent-dark); }
.tag-red { background: var(--red-light); color: var(--red); }
.tag-muted { background: var(--surface-alt); color: var(--muted); }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; cursor: pointer; font-weight: 700; font-size: 13.5px; padding: 10px 16px; border-radius: 11px; transition: transform .08s, opacity .15s, background .15s; font-family: inherit; }
.btn:active { transform: scale(.97); }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: var(--surface-alt); color: var(--primary-dark); }
.btn-ghost:hover { background: var(--primary-light); }
.btn-warn { background: var(--warn-light); color: var(--warn); }
.btn-danger { background: var(--red-light); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }

/* ---- Forms ---- */
.form { max-width: 760px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .search input {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; font-size: 14px; font-family: inherit; color: var(--text);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.field textarea { resize: vertical; }
.field input[type="file"] { padding: 9px; background: var(--surface-alt); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); margin-bottom: 16px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.current-img { display: flex; align-items: center; gap: 12px; margin: -6px 0 16px; }
.current-img img { width: 90px; height: 64px; object-fit: cover; border-radius: 10px; }

.search { display: flex; gap: 8px; }
.search input { width: 220px; padding: 8px 12px; }

.back { display: inline-block; color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.back:hover { color: var(--primary-dark); }

/* ---- Question detail ---- */
.q-detail-head { display: flex; gap: 6px; margin-bottom: 10px; }
.q-detail h2 { margin: 6px 0; color: var(--text); }
.q-body { color: var(--text); line-height: 1.7; }
.q-img, .a-img { max-width: 320px; border-radius: 12px; margin-top: 10px; display: block; }
.q-meta { color: var(--muted); font-size: 13px; margin-top: 10px; }
.answer { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.answer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 10px; flex-wrap: wrap; }
.answer p { margin: 6px 0; line-height: 1.6; }
.answer-actions { margin-top: 8px; }

/* ---- Alerts ---- */
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; font-size: 13.5px; }
.alert-success { background: var(--green-light); color: var(--green); }
.alert-error { background: var(--red-light); color: var(--red); }

/* ---- Login ---- */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #AFC4E6, #F2C4CF); padding: 20px; }
.login-card { background: var(--surface); width: 100%; max-width: 380px; border-radius: 22px; padding: 34px 30px; box-shadow: 0 20px 50px rgba(46,58,77,.18); }
.login-brand { text-align: center; margin-bottom: 22px; }
.login-logo { font-size: 30px; font-weight: 800; color: var(--primary-dark); }
.login-sub { color: var(--muted); font-weight: 600; margin-top: 2px; }
.login-note { text-align: center; color: var(--label); font-size: 12px; margin-top: 16px; }

/* ---- Responsive / Mobil ---- */
@media (max-width: 900px) {
  /* Sidebar → off-canvas çekmece */
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 264px; z-index: 40;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 0 0 40px rgba(46,58,77,.18);
  }
  .nav-toggle:checked ~ .layout .sidebar { transform: translateX(0); }
  .nav-toggle:checked ~ .layout .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 30;
    background: rgba(46,58,77,.4);
  }
  .hamburger { display: inline-flex; }

  .topbar { padding: 16px 18px; position: sticky; }
  .topbar h1 { font-size: 17px; }
  .content { padding: 18px; }

  /* Tabloları yatay kaydırılabilir yap */
  .panel { overflow-x: auto; }
  .table { min-width: 560px; }

  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-val { font-size: 22px; }
  .grid-2 { grid-template-columns: 1fr; }
  .search input { width: 150px; }
  .form { max-width: 100%; }
}

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .actions { gap: 4px; }
  .btn-sm { padding: 6px 9px; font-size: 12px; }
}
