:root {
  --dark: #1f2024;
  --brand: #5ebda9;
  --brand-dark: #4aa48f;
  --brand-light: #eaf7f3;
  --bg: #f5f6f8;
  --border: #e3e4e6;
  --text-muted: #6b6f76;
  --text-faint: #8b8f96;
  --danger: #e05353;
  --danger-dark: #c0392b;
  --success: #1e8a63;
  --warning: #a8710a;
  --shadow: 0 1px 3px rgba(20,20,25,.06);
  --shadow-hover: 0 6px 20px rgba(20,20,25,.1);
  --radius: 12px;
}
* { box-sizing: border-box; }
body.admin-body {
  margin: 0; font-family: 'Inter', 'Segoe UI', system-ui, Arial, sans-serif;
  background: var(--bg); color: var(--dark); -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 230px; background: var(--dark); color: #d7dade; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; padding: 22px 0; flex-shrink: 0; z-index: 500;
}
.admin-brand { padding: 0 22px 20px; border-bottom: 1px solid #34353a; display: flex; align-items: center; justify-content: space-between; }
.admin-brand img { height: 34px; filter: brightness(0) invert(1); }
.admin-brand-close { display: none; background: none; border: none; color: #d7dade; padding: 4px; cursor: pointer; }
.admin-brand-close svg { width: 20px; height: 20px; }
.admin-nav { display: flex; flex-direction: column; padding: 16px 12px; gap: 3px; flex: 1; overflow-y: auto; }
.admin-nav a {
  padding: 10px 14px; border-radius: 8px; font-size: 14.5px; font-weight: 600; color: #c6c9ce;
  transition: background .15s, color .15s; border-left: 3px solid transparent;
}
.admin-nav a:hover { background: #2b2c31; color: #fff; }
.admin-nav a.active { background: var(--brand); color: #fff; }
.admin-nav a.admin-logout { margin-top: auto; color: #e57373; }
.admin-nav-badge { background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.admin-user { padding: 14px 22px; border-top: 1px solid #34353a; font-size: 13px; }
.admin-user span { display: block; color: #8b8f96; text-transform: capitalize; }

.admin-mobile-topbar { display: none; }
.admin-nav-toggle { display: none; }
.admin-nav-overlay { display: none; }

.admin-content { flex: 1; min-width: 0; padding: 30px 36px; max-width: 1200px; }
.admin-page-title { font-size: 24px; margin: 0 0 20px; letter-spacing: -.2px; }
.admin-section-title { font-size: 18px; margin: 30px 0 14px; }
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--brand-dark); font-weight: 600; }

.admin-tabs { display: flex; gap: 8px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.admin-tabs a { padding: 10px 16px; font-size: 14px; font-weight: 600; color: #6b6f76; border-bottom: 2px solid transparent; }
.admin-tabs a.active { color: var(--brand-dark); border-bottom-color: var(--brand); }

.admin-maintenance-card {
  display: flex; align-items: center; gap: 20px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 22px; box-shadow: var(--shadow); flex-wrap: wrap;
}
.admin-maintenance-card.is-on { border-color: #f0c36d; background: #fffaf0; }
.admin-maintenance-card > div:first-child { flex: 1; }
.admin-maintenance-card strong { font-size: 15px; }
.admin-maintenance-card p { margin: 4px 0 0; font-size: 13px; color: #6b6f76; }
.admin-maintenance-card form { margin: 0; }
.admin-toggle-switch {
  width: 52px; height: 30px; border-radius: 999px; background: #d5d7da; border: none; position: relative;
  cursor: pointer; padding: 0; flex-shrink: 0; transition: background .15s;
}
.admin-toggle-switch.is-on { background: #e0a530; }
.admin-toggle-knob {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s;
}
.admin-toggle-switch.is-on .admin-toggle-knob { left: 25px; }

.admin-stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.admin-stat-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s;
}
.admin-stat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.admin-stat-card .num { font-size: 27px; font-weight: 800; color: var(--brand-dark); letter-spacing: -.3px; }
.admin-stat-card .label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.admin-table-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table tbody tr { transition: background .12s; }
.admin-table tbody tr:hover { background: #fafbfb; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table th { background: #fafafa; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--text-muted); font-weight: 700; }
.admin-table a { color: var(--brand-dark); font-weight: 600; }
.admin-table td.wrap { white-space: normal; max-width: 360px; }

.admin-badge { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: capitalize; white-space: nowrap; }
.admin-badge-published { background: #e2f6ee; color: #1e8a63; }
.admin-badge-draft { background: #fff3d6; color: #a8710a; }
.admin-badge-archived { background: #eee; color: #777; }

/* Satir islemleri (tablo icindeki Duzenle/Sil/Onayla vb. butonlar) */
.admin-row-actions { display: flex; gap: 14px; align-items: center; }
.admin-link-btn {
  border: none; background: none; padding: 0; cursor: pointer; font-weight: 700; font-size: 13px;
  color: var(--brand-dark); font-family: inherit; transition: opacity .12s;
}
.admin-link-btn:hover { opacity: .75; }
.admin-link-btn-danger { color: var(--danger); }
.admin-link-btn-success { color: var(--success); }
.admin-link-btn-warning { color: var(--warning); }

/* Sayfalama */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.pagination a {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; font-weight: 600;
  background: #fff; transition: background .12s, border-color .12s;
}
.pagination a:hover { border-color: #d5d7da; background: #fafbfb; }
.pagination a.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Arama / filtre kontrolleri (toolbar icinde) */
.admin-toolbar-meta { margin: 0; font-size: 15px; color: var(--text-muted); font-weight: 600; }
.admin-search-input, .admin-select {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff;
}
.admin-filter-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* Kucuk yuvarlak avatar (kullanicilar tablosu vb.) */
.avatar-32 { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: block; }
.avatar-32-fallback { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 11px; }

.admin-cover-preview { max-width: 160px; border-radius: 8px; margin-top: 8px; display: block; box-shadow: var(--shadow); }

.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.admin-btn {
  background: var(--brand); color: #fff; border: none; padding: 10px 18px; border-radius: 8px;
  font-weight: 700; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, box-shadow .15s;
}
.admin-btn:hover { background: var(--brand-dark); box-shadow: var(--shadow-hover); }
.admin-btn-secondary { background: #eceeef; color: var(--dark); }
.admin-btn-secondary:hover { background: #e0e2e4; box-shadow: none; }
.admin-btn-danger { background: var(--danger); }
.admin-btn-danger:hover { background: var(--danger-dark); }
.admin-btn-sm { padding: 6px 12px; font-size: 12.5px; }

.admin-form { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; max-width: 820px; box-shadow: var(--shadow); }
.admin-form label { display: block; font-weight: 700; font-size: 13.5px; margin: 16px 0 6px; }
.admin-form input[type=text], .admin-form input[type=url], .admin-form input[type=email],
.admin-form input[type=password], .admin-form input[type=file], .admin-form select, .admin-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit;
  transition: border-color .15s;
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus,
.admin-search-input:focus, .admin-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.admin-form textarea { resize: vertical; }
.admin-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.admin-form .hint { font-size: 12.5px; color: #8b8f96; margin-top: 4px; }
.admin-form .actions { margin-top: 24px; display: flex; gap: 10px; }
.admin-form .checkbox-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.admin-form .checkbox-row input { width: auto; }
.admin-form .checkbox-row label { margin: 0; }

/* Durum secimi: radio-pill grubu */
.radio-pill-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-pill { position: relative; cursor: pointer; }
.radio-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-pill span {
  display: inline-block; padding: 9px 18px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 13.5px; font-weight: 700; color: #6b6f76; transition: background .15s, color .15s, border-color .15s;
}
.radio-pill input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }
.radio-pill input:checked + span { background: var(--dark); color: #fff; border-color: var(--dark); }
.radio-pill-published input:checked + span { background: #1e8a63; border-color: #1e8a63; }
.radio-pill-archived input:checked + span { background: #8b8f96; border-color: #8b8f96; }

/* Ozellik anahtarlari (toggle switch) */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; margin-top: 14px;
}
.toggle-row strong { font-size: 14px; display: block; }
.toggle-row p { margin: 2px 0 0; font-size: 12.5px; color: #8b8f96; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; inset: 0; background: #d5d7da; border-radius: 999px; transition: background .15s; }
.switch-knob {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s;
}
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track .switch-knob { left: 23px; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Zengin metin editoru (icerik alani) */
.rte-wrap { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.rte-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; background: #f7f8f8; border-bottom: 1px solid var(--border); }
.rte-btn {
  background: none; border: 1px solid transparent; border-radius: 5px; padding: 6px 10px; font-size: 13px;
  font-weight: 700; color: var(--dark); cursor: pointer; min-width: 32px; text-align: center; line-height: 1.2;
}
.rte-btn:hover { background: #eceeef; border-color: var(--border); }
.rte-btn-text { font-size: 12px; }
.rte-btn-html { margin-left: auto; font-size: 11.5px; letter-spacing: .3px; border: 1px solid var(--border); }
.rte-sep { width: 1px; align-self: stretch; background: var(--border); margin: 2px 4px; }
.rte-editor {
  min-height: 320px; max-height: 640px; overflow-y: auto; padding: 14px 16px; font-size: 15px; line-height: 1.7;
  outline: none; font-family: inherit; background: #fff;
}
.rte-editor h2 { font-size: 20px; margin: 18px 0 8px; }
.rte-editor h3 { font-size: 17px; margin: 16px 0 8px; }
.rte-editor p { margin: 0 0 12px; }
.rte-editor blockquote { margin: 12px 0; padding: 10px 16px; border-left: 3px solid var(--brand); background: var(--brand-light); border-radius: 0 6px 6px 0; }
.rte-editor a { color: var(--brand-dark); text-decoration: underline; }
.rte-editor img { max-width: 100%; border-radius: 6px; }
.rte-wrap .rte-html-view {
  display: none; width: 100%; min-height: 320px; border: none; border-radius: 0; padding: 14px 16px;
  font-family: 'Consolas', 'Courier New', monospace; font-size: 13px; resize: vertical;
}
.rte-wrap.html-mode .rte-editor { display: none; }
.rte-wrap.html-mode .rte-html-view { display: block; }
.rte-wrap.html-mode .rte-btn:not(.rte-btn-html) { opacity: .35; pointer-events: none; }
.rte-wrap.html-mode .rte-btn-html { background: var(--dark); color: #fff; border-color: var(--dark); }

.admin-alert { background: #fdeaea; color: #c0392b; padding: 12px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; }
.admin-alert-success { background: #e2f6ee; color: #1e8a63; }

.admin-login-body {
  margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 20%, #2a2b30 0%, var(--dark) 55%, #16171a 100%);
  font-family: 'Inter', 'Segoe UI', system-ui, Arial, sans-serif; padding: 20px;
}
.admin-login-box { background: #fff; padding: 36px 32px; border-radius: 16px; width: 340px; max-width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.admin-login-logo { height: 40px; margin: 0 auto 18px; display: block; }
.admin-login-box h1 { font-size: 20px; text-align: center; margin: 0 0 20px; }
.admin-login-box label { font-size: 13px; font-weight: 700; display: block; margin: 12px 0 6px; }
.admin-login-box input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.admin-login-box button { width: 100%; margin-top: 20px; background: var(--brand); color: #fff; border: none; padding: 12px; border-radius: 8px; font-weight: 700; font-size: 15px; cursor: pointer; }
.admin-login-box button:hover { background: var(--brand-dark); }
.admin-login-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 4px; color: #9a9ea5; font-size: 12.5px; }
.admin-login-divider::before, .admin-login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.admin-google-btn {
  width: 100%; background: #fff !important; color: var(--dark) !important; border: 1px solid var(--border) !important;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.admin-google-btn:hover { background: #f7f8f8 !important; }
.admin-google-btn .google-signin-icon { width: 18px; height: 18px; }
.admin-login-fallback-toggle { text-align: center; margin: 14px 0 0; }
.admin-login-fallback-toggle a { font-size: 12.5px; color: #9a9ea5; }
.admin-login-fallback-toggle a:hover { color: var(--brand-dark); }
#passwordFormFields button { margin-top: 16px; }

/* Kullanici detay sayfasi */
.user-detail-header {
  display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow); flex-wrap: wrap;
}
.user-detail-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.user-detail-avatar-fallback { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 18px; }
.user-detail-info { min-width: 0; }
.user-detail-meta { margin: 4px 0 0; color: var(--text-muted); font-size: 13.5px; }
.user-detail-action { margin-left: auto; }
.admin-section-title-link { font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-left: 8px; }
.admin-section-title-link:hover { color: var(--brand-dark); }
.admin-table code {
  background: #f2f3f4; padding: 2px 6px; border-radius: 4px; font-size: 12px; font-family: 'Consolas', 'Courier New', monospace;
}

@media (max-width: 900px) {
  .admin-shell { flex-direction: column; }

  .admin-mobile-topbar {
    display: flex; align-items: center; gap: 12px; background: var(--dark); padding: 12px 16px;
    position: sticky; top: 0; z-index: 600;
  }
  .admin-mobile-topbar img { height: 28px; filter: brightness(0) invert(1); }
  .admin-mobile-topbar .admin-page-title-mobile { color: #fff; font-size: 15.5px; font-weight: 700; margin: 0; flex: 1; }
  .admin-nav-toggle {
    display: flex; align-items: center; justify-content: center; background: none; border: none;
    color: #fff; padding: 4px; cursor: pointer; flex-shrink: 0;
  }
  .admin-nav-toggle svg { width: 24px; height: 24px; }

  .admin-sidebar {
    position: fixed; top: 0; left: 0; width: 260px; max-width: 82%; height: 100vh; z-index: 700;
    transform: translateX(-100%); transition: transform .25s ease; box-shadow: 8px 0 30px rgba(0,0,0,.25);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-brand { display: block; }
  .admin-brand-close { display: flex !important; }
  .admin-user { display: block; }

  .admin-nav-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 650;
  }
  .admin-nav-overlay.open { display: block; }

  .admin-content { padding: 18px; max-width: 100%; }
  .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-form .row { grid-template-columns: 1fr; }
  .admin-toolbar { align-items: stretch; }
  .admin-filter-group { flex-direction: column; align-items: stretch; }
  .admin-table th, .admin-table td { padding: 10px 12px; font-size: 13.5px; }
}

@media (max-width: 480px) {
  .admin-stat-grid { grid-template-columns: 1fr 1fr; }
  .admin-login-box { padding: 28px 22px; }
  .admin-form { padding: 18px; }
}
