:root {
  --primary: #E2001A;
  --primary-dark: #A5000F;
  --bg: #f4f5f7;
  --card: #ffffff;
  --border: #e0e2e7;
  --text: #1c1f26;
  --text-muted: #6b7280;
  --success: #1a7f37;
  --error: #c62828;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}
.login-box {
  background: var(--card); padding: 40px; border-radius: 14px;
  width: 340px; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-box h1 { font-size: 20px; margin: 0 0 20px; text-align: center; }
label { display: block; font-size: 13px; color: var(--text-muted); margin: 14px 0 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; background: #fff;
}
textarea { resize: vertical; }
button, .btn {
  display: inline-block; margin-top: 18px; padding: 10px 16px; border: none; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover { background: var(--primary-dark); }
.btn-danger { background: var(--error); }
.btn-danger:hover { background: #8e1d1d; }
.btn-danger:disabled { background: #d9a3a3; cursor: not-allowed; }
.toolbar button { margin-top: 0; }
.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.alert-error { background: #fdecea; color: var(--error); border: 1px solid #f5c6cb; }
.alert-success { background: #e9f7ef; color: var(--success); border: 1px solid #c3e6cb; }
.muted { color: var(--text-muted); font-size: 13px; }
.secret-box {
  font-family: monospace; font-size: 18px; letter-spacing: 2px; background: #f4f5f7;
  padding: 12px; border-radius: 8px; text-align: center; word-break: break-all;
}

.topnav {
  background: #1c1f26; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 54px; flex-wrap: wrap;
}
.topnav-brand { color: #fff; font-weight: 700; font-size: 15px; }
.topnav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav-links a {
  color: #cbd0dc; text-decoration: none; font-size: 13px; padding: 8px 10px; border-radius: 6px;
}
.topnav-links a:hover { background: #2a2e38; color: #fff; }
.topnav-links a.active { background: var(--primary); color: #fff; }
.topnav-links a.logout-link { color: #ff8a8a; }

/* "Canlı Destek" nav sekmesindeki okunmamış mesaj/bekleyen talep rozeti -
   TÜM sayfalarda görünür (bkz. includes/nav.php + assets/admin.js'teki 7)
   numaralı global bölüm). Animasyon, rozet kaybolana (mesajlar okununcaya)
   KADAR sürer. */
.nav-badge {
  display: none; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 999px; background: #ef4444; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
  vertical-align: middle;
}
.nav-badge.nav-badge-pulse { animation: nav-badge-pulse 1.4s ease-in-out infinite; }
@keyframes nav-badge-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239,68,68,0.55); }
  50% { transform: scale(1.18); box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

.container { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
h1 { font-size: 22px; margin-bottom: 18px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 20px; margin-bottom: 20px;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
tr:hover td { background: #fafbfc; }
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
}
.badge-active { background: #e9f7ef; color: var(--success); }
.badge-inactive { background: #fdecea; color: var(--error); }
.badge-warning { background: #fff4e5; color: #b45309; }
.actions { display: flex; gap: 8px; }
.actions form { display: inline; }
.actions button { margin-top: 0; padding: 6px 10px; font-size: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.stat-card .num { font-size: 28px; font-weight: 700; color: var(--primary-dark); }
.stat-card .label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }
.quick-dates { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.quick-dates button { margin-top: 0; padding: 6px 10px; font-size: 12px; background: #6b7280; }
.quick-dates button:hover { background: #4b5563; }

/* Açma/kapama (on/off) ayarları için görsel toggle anahtarı. Altında normal
   bir <input type="checkbox"> kullanır (JS tarafı .checked ile aynen
   çalışmaya devam eder) - sadece görünümü değiştirir, davranışı değil.
   Kullanım: <label class="toggle-switch"><input type="checkbox" id="...">
   <span class="toggle-slider"></span>Metin</label> */
.toggle-switch {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer; font-weight: normal; margin: 0; font-size: 14px; color: var(--text);
}
.toggle-switch input[type=checkbox] {
  position: absolute; opacity: 0; width: 0; height: 0; margin: 0;
}
.toggle-switch .toggle-slider {
  position: relative; width: 42px; height: 24px; flex-shrink: 0;
  background: #cbd0dc; border-radius: 999px; transition: background .2s ease;
}
.toggle-switch .toggle-slider::before {
  content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; transition: transform .2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.toggle-switch input[type=checkbox]:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input[type=checkbox]:checked + .toggle-slider::before { transform: translateX(18px); }
.toggle-switch input[type=checkbox]:focus-visible + .toggle-slider { outline: 2px solid var(--primary-dark); outline-offset: 2px; }
.toggle-switch input[type=checkbox]:disabled + .toggle-slider { opacity: .5; cursor: not-allowed; }

/* Dashboard (index.php) - okunmamış destek mesajı / bekleyen talep
   kartları ve uyarı banner'ı. Sayı 0'a düşene (yani mesajlar/talepler
   OKUNANA) KADAR animasyon sürer - bkz. assets/admin.js'teki
   updateDashboardWidgets(). */
.stat-card-alert {
  border-color: #ef4444;
  animation: stat-card-alert-pulse 1.6s ease-in-out infinite;
}
@keyframes stat-card-alert-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.35); }
  50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}
.alert-pulse { animation: alert-pulse-glow 1.6s ease-in-out infinite; }
@keyframes alert-pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(198,40,40,0.35); }
  50% { box-shadow: 0 0 0 6px rgba(198,40,40,0); }
}

/* Canlı destek - mesaj baloncuğu içindeki resim eki küçük önizlemesi
   (bkz. assets/admin.js - renderMessage). Tıklanınca büyütme penceresi
   (lightbox) açılır - artık ayrı bir sekmede DEĞİL. */
.msg-attachment-thumb {
  max-width: 220px; max-height: 220px; border-radius: 6px; display: block;
  margin-top: 6px; cursor: zoom-in; border: 1px solid rgba(128,128,128,0.25);
}

/* Resim büyütme penceresi (lightbox) - support.php'de dinamik olarak
   assets/admin.js tarafından oluşturulur (bkz. ensureLightbox). */
.support-lightbox {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.85); align-items: center; justify-content: center;
}
.support-lightbox.open { display: flex; }
.support-lightbox-img {
  max-width: 90vw; max-height: 85vh; transition: transform .15s ease;
  cursor: grab; user-select: none; border-radius: 4px;
}
.support-lightbox-toolbar {
  position: absolute; top: 14px; right: 14px; display: flex; gap: 8px;
}
.support-lightbox-btn {
  margin-top: 0; padding: 8px 14px; font-size: 16px; line-height: 1;
  background: rgba(255,255,255,0.12); color: #fff;
  border: 1px solid rgba(255,255,255,0.3); border-radius: 6px; cursor: pointer;
}
.support-lightbox-btn:hover { background: rgba(255,255,255,0.25); }


/* Topnav Dropdown Desteği */
.topnav-dropdown { position: relative; display: inline-block; }
.topnav-dropdown-btn {
  color: #cbd0dc; text-decoration: none; font-size: 13px; padding: 8px 10px; border-radius: 6px;
  cursor: pointer; display: flex; align-items: center; gap: 4px;
}
.topnav-dropdown-btn:hover, .topnav-dropdown:hover .topnav-dropdown-btn {
  background: #2a2e38; color: #fff;
}
.topnav-dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0; background: #1c1f26; min-width: 200px;
  border-radius: 6px; padding: 6px 0; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  border: 1px solid #2a2e38; z-index: 1000;
}
.topnav-dropdown:hover .topnav-dropdown-menu { display: block; }
.topnav-dropdown-menu a {
  color: #cbd0dc; text-decoration: none; font-size: 12.5px; padding: 8px 14px; display: block;
  border-radius: 0;
}
.topnav-dropdown-menu a:hover { background: var(--primary); color: #fff; }
.topnav-dropdown-menu a.active { background: var(--primary-dark); color: #fff; }
