/* ============================================================
   KarşıyakaHaber – Admin Panel Stil
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:      #d60000;
  --green:    #16a34a;
  --green-d:  #14532d;
  --dark:     #0f172a;
  --sidebar:  #1e2d1f;
  --mid:      #64748b;
  --light:    #f1f5f9;
  --white:    #ffffff;
  --border:   #e2e8f0;
  --success:  #16a34a;
  --danger:   #dc2626;
  --warning:  #d97706;
  --info:     #0284c7;
}

html, body { height: 100%; }
body { font-family: 'Inter', sans-serif; background: #f0f4f0; color: #1e293b; font-size: 14px; }
a    { text-decoration: none; color: inherit; }

/* ── LAYOUT ─────────────────────────────────────── */
.admin-wrap { display: flex; min-height: 100vh; }

/* ── SIDEBAR ─────────────────────────────────────── */
.admin-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--sidebar);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  overflow-y: auto; z-index: 100;
}
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo .logo-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px; font-weight: 900; font-style: italic;
  color: #fff; line-height: 1;
}
.sidebar-logo .logo-text span { color: var(--green); }
.sidebar-logo small { font-size: 10px; color: rgba(255,255,255,.4); letter-spacing: 1px; display: block; margin-top: 2px; }

.sidebar-nav { padding: 12px 0; flex: 1; }
.nav-group { margin-bottom: 4px; }
.nav-group-title {
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(255,255,255,.3); padding: 10px 20px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.65);
  font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(22,163,74,.18); color: #4ade80; border-left-color: var(--green); font-weight: 700; }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 800;
  padding: 2px 7px; border-radius: 99px;
}

.sidebar-bottom {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 8px;
  background: rgba(255,255,255,.06);
}
.sidebar-user img {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
}
.sidebar-user .user-avatar-default {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-size: 12.5px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { font-size: 10.5px; color: rgba(255,255,255,.45); }
.sidebar-user .logout-btn {
  color: rgba(255,255,255,.4); font-size: 16px;
  transition: color .2s;
}
.sidebar-user .logout-btn:hover { color: var(--red); }

/* ── MAIN ─────────────────────────────────────── */
.admin-main { margin-left: 240px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ── TOPBAR ─────────────────────────────────────── */
.admin-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.topbar-title { font-size: 17px; font-weight: 800; color: #0f172a; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 7px;
  font-size: 13px; font-weight: 700;
  cursor: pointer; border: none; font-family: inherit;
  transition: opacity .2s;
}
.topbar-btn:hover { opacity: .85; }
.btn-green  { background: var(--green); color: #fff; }
.btn-red    { background: var(--red);   color: #fff; }
.btn-light  { background: var(--light); color: #374151; border: 1px solid var(--border); }

/* ── CONTENT ─────────────────────────────────────── */
.admin-content { padding: 24px 28px; flex: 1; }

/* ── STAT CARDS ─────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; margin-bottom: 28px; }
.stat-card {
  background: var(--white); border-radius: 12px; padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  display: flex; align-items: center; gap: 16px;
  border-left: 4px solid var(--green);
}
.stat-card.red   { border-left-color: var(--red); }
.stat-card.blue  { border-left-color: var(--info); }
.stat-card.gold  { border-left-color: var(--warning); }
.stat-icon { font-size: 32px; flex-shrink: 0; }
.stat-info { flex: 1; }
.stat-num  { font-size: 28px; font-weight: 900; color: var(--dark); line-height: 1; }
.stat-lbl  { font-size: 12px; color: var(--mid); margin-top: 3px; font-weight: 500; }

/* ── TABLE ─────────────────────────────────────── */
.table-card { background: var(--white); border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.06); overflow: hidden; }
.table-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.table-header h2 { font-size: 15px; font-weight: 800; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--light);
  padding: 11px 16px; text-align: left;
  font-size: 11.5px; font-weight: 700; color: var(--mid);
  letter-spacing: .5px; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fef9; }
tbody td { padding: 12px 16px; font-size: 13.5px; vertical-align: middle; }
.td-resim img { width: 56px; height: 40px; border-radius: 5px; object-fit: cover; }
.td-resim-placeholder { width: 56px; height: 40px; border-radius: 5px; background: var(--light); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.td-baslik { font-weight: 600; max-width: 320px; }
.td-baslik a:hover { color: var(--green); }
.td-baslik small { display: block; font-size: 11.5px; color: var(--mid); font-weight: 400; margin-top: 2px; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.badge-yayinda  { background: #dcfce7; color: #15803d; }
.badge-taslak   { background: #fef9c3; color: #854d0e; }
.badge-red      { background: #fee2e2; color: #991b1b; }
.badge-blue     { background: #dbeafe; color: #1d4ed8; }
.badge-admin    { background: #f3e8ff; color: #7c3aed; }

/* Actions */
.td-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.btn-action {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 6px; border: none;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: opacity .2s;
}
.btn-action:hover { opacity: .8; }
.btn-edit   { background: #dbeafe; color: #1d4ed8; }
.btn-delete { background: #fee2e2; color: #991b1b; }
.btn-view   { background: #dcfce7; color: #15803d; }

/* ── FORM ─────────────────────────────────────── */
.form-card { background: var(--white); border-radius: 12px; padding: 28px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { margin-bottom: 18px; }
.form-group.full { grid-column: 1/-1; }
.form-label { display: block; font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 6px; }
.form-label span { color: var(--red); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit;
  outline: none; transition: border .2s, box-shadow .2s;
  background: #fff;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22,163,74,.1);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 11.5px; color: var(--mid); margin-top: 5px; }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--green); cursor: pointer; }
.form-check label { font-size: 13.5px; font-weight: 500; cursor: pointer; }
.resim-onizleme { width: 100%; height: 180px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); margin-top: 8px; }
.form-submit { display: flex; gap: 12px; padding-top: 8px; }

/* ── ALERT ─────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-danger   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning  { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }

/* ── PAGINATION ─────────────────────────────────────── */
.admin-pagination { display: flex; gap: 6px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.admin-pagination a, .admin-pagination span {
  padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 600;
  background: var(--light); border: 1px solid var(--border);
}
.admin-pagination a:hover { background: var(--green); color: #fff; border-color: var(--green); }
.admin-pagination .aktif  { background: var(--green); color: #fff; border-color: var(--green); }

/* ── SEARCH BAR ─────────────────────────────────────── */
.search-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.search-bar input, .search-bar select {
  padding: 9px 14px; border: 1.5px solid var(--border); border-radius: 7px;
  font-size: 13.5px; font-family: inherit; outline: none;
  transition: border .2s; background: #fff;
}
.search-bar input { flex: 1; min-width: 200px; }
.search-bar input:focus, .search-bar select:focus { border-color: var(--green); }

/* ── DASHBOARD CHARTS ─────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.dash-card { background: var(--white); border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.dash-card h3 { font-size: 14px; font-weight: 800; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }

/* ── LOGIN ─────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--sidebar), #0d1f0f); }
.login-card { background: var(--white); border-radius: 16px; padding: 40px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-text { font-family: 'Barlow Condensed', sans-serif; font-size: 36px; font-weight: 900; font-style: italic; color: var(--dark); }
.login-logo .logo-text span { color: var(--green); }
.login-logo small { font-size: 11px; color: var(--mid); letter-spacing: 1px; }
.login-title { font-size: 20px; font-weight: 800; margin-bottom: 22px; color: var(--dark); }
