/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   NewsRadar · Admin paneli
   styles.css'in token'larını miras alıyor.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

body { background: var(--bg); }

/* ─── Login ─────────────────────────────────────────────── */

.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.logo-center {
  align-self: center;
  margin-bottom: 8px;
}

.login-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: center;
}
.login-sub {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.field > span small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  margin-top: 2px;
  color: var(--text-faint);
}
.field input,
.field select {
  height: 38px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  color: var(--text);
  outline: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.login-error,
.modal-error {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
}

.login-submit {
  width: 100%;
  justify-content: center;
  height: 42px;
  margin-top: 4px;
}

.login-back {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  margin-top: 4px;
}
.login-back:hover { color: var(--accent); }

/* ─── Panel sekmeleri ──────────────────────────────────── */

.admin-tabs {
  display: flex;
  gap: 4px;
  margin-left: 16px;
}
.admin-tab {
  background: transparent;
  border: 0;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.admin-tab:hover { color: var(--text); background: var(--bg); }
.admin-tab.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.admin-user {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ─── Panel iç düzeni ──────────────────────────────────── */

.admin-tab-panel {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.admin-toolbar-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.admin-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.admin-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
}

.admin-search { width: 260px; }
.admin-search input { height: 36px; }

/* ─── Kaynak tablosu ───────────────────────────────────── */

.admin-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.admin-table thead th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table tbody td {
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tbody tr:hover { background: var(--surface-hover); }

.admin-table .cell-flag { width: 30px; }
.admin-table .cell-name { font-weight: 600; color: var(--text); }
.admin-table .cell-url {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-table .cell-url a { color: inherit; text-decoration: none; }
.admin-table .cell-url a:hover { color: var(--accent); }
.admin-table .cell-actions { text-align: right; white-space: nowrap; }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-transform: lowercase;
}
.pill-rss { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill-scrape { background: var(--bg); color: var(--text-muted); }
.pill-all {
  background: linear-gradient(90deg, rgba(217,38,38,.12), rgba(99,102,241,.12));
  color: var(--text);
  border-color: transparent;
  font-weight: 700;
}

.admin-table .cell-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--text);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}
.admin-table .cell-count:empty,
.admin-table tbody td.cell-count {
  /* sayı = 0 ise daha soluk göster */
}
.admin-table tbody tr td.cell-count {
  /* tut */
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.btn-danger:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-secondary:hover { background: var(--bg); border-color: var(--border-strong); }

/* ─── Kategori kartları ────────────────────────────────── */

.category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.category-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.category-card-label {
  font-weight: 600;
  font-size: 14px;
}
.category-card-slug {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* ─── Modal ─────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  animation: fade-in 0.15s;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  animation: scale-in 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 16px; font-weight: 700; }
.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ─── Toast ─────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--surface);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 200;
  animation: toast-in 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast.toast-error { background: var(--accent); color: var(--accent-text); }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ─── Yardımcı ──────────────────────────────────────────── */

.state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.admin-hint {
  margin: -8px 0 16px;
  color: var(--text-muted);
  font-size: 13px;
  max-width: 720px;
  line-height: 1.6;
}

/* ─── Backfill (eksik tarihleri tamamla) şeridi ─── */
.backfill-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(90deg, rgba(217,38,38,.05), rgba(99,102,241,.05));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.backfill-info { flex: 1; min-width: 200px; font-size: 14px; color: var(--text); }
.backfill-info strong { color: var(--accent); font-size: 18px; margin-right: 4px; }
.backfill-info small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.backfill-progress {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
}
.backfill-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.backfill-bar #backfill-bar-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.4s ease;
}
#backfill-status {
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.backfill-banner .btn-primary:disabled { opacity: 0.7; }

/* ─── Kullanıcı kartları (admin → Kullanıcılar) ─── */

.user-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.user-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.user-card-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
  user-select: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.user-card-info { flex: 1; min-width: 0; }
.user-card-name {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text);
}
.user-card-meta {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
}
.user-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.btn-icon-sm {
  width: 30px;
  height: 30px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn-icon-sm:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--bg);
}

/* ─── Kullanıcı modal — önizleme ─── */

.modal-card-wide { max-width: 540px; }

.user-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.user-preview-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 22px;
  color: #fff;
  background: #3b82f6;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
  transition: background 0.18s;
}
.user-preview-info { min-width: 0; }
.user-preview-name {
  font-weight: 700;
  font-size: 15px;
}
.user-preview-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

/* ─── İkon paleti ─── */

.icon-palette {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}
.icon-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  font-size: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.12s, background 0.12s, transform 0.08s;
}
.icon-swatch:hover {
  border-color: var(--border-strong);
  background: var(--bg);
}
.icon-swatch.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.08);
}

/* ─── Renk paleti ─── */

.color-palette {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.color-swatch {
  height: 28px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.08s, box-shadow 0.12s;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.color-swatch:hover { transform: scale(1.08); }
.color-swatch.active {
  border-color: var(--text);
  box-shadow: inset 0 0 0 2px var(--surface), 0 0 0 2px var(--text);
}

/* native color picker küçük dursun */
input[type="color"] {
  width: 48px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  background: var(--surface);
}
