:root {
  --accent: #3b82f6;
  --danger: #e5484d;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 12px;
}

body.dark {
  --bg: #0b1220;
  --card: #111a2e;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: rgba(255, 255, 255, 0.05);
}

body.light {
  --bg: #ffffff;
  --card: #f3f4f6;
  --text: #000000;
  --muted: #4b5563;
  --border: rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  /* Sayfa kaydırmayı kapatır, sadece iç paneller kayar */
}

/* LAYOUT */
.dashboard-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* 1. SIDEBAR */
.sidebar {
  width: 320px;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.brand {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  max-height: 60px;
}

.side-menu {
  display: flex;
  flex-direction: column;
  padding: 15px 10px;
  flex: 1;
}

.menu-item {
  color: var(--muted);
  text-decoration: none;
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  transition: all 0.2s;
}

.menu-item:hover,
.menu-item.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent);
}

.mt-auto {
  margin-top: auto;
}

/* Logs menüsünü en alta iter */

.sidebar-footer {
  padding: 15px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 15px;
}

.control-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 35px;
  height: 35px;
  border-radius: 8px;
  cursor: pointer;
}

.staff-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.staff-avatar {
  background: var(--accent);
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.staff-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.staff-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.staff-role {
  font-size: 0.75rem;
  color: var(--success);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- ÇIKIŞ YAP (LOGOUT) İKONU --- */
#btnLogout {
  margin-left: auto;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.2s;
}

#btnLogout:hover {
  color: var(--danger);
  /* Üzerine gelince uyarı (kırmızı) rengi alır */
}

/* 2. TICKET LIST PANE */
.ticket-list-pane {
  width: 350px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.pane-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  /* Başlık ve uyarı rozetini alt alta dizer */
  gap: 10px;
}

.pane-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.pane-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pane-header-controls i {
  cursor: pointer;
  color: var(--muted);
  transition: color 0.2s;
  font-size: 1.1rem;
}

.pane-header-controls i:hover {
  color: var(--text);
}

.pane-header h2 {
  font-size: 1.1rem;
}

.ticket-items {
  flex: 1;
  overflow-y: auto;
}

.ticket-item {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}

.ticket-item:hover {
  background: var(--card);
}

.ticket-item.active {
  background: var(--card);
  border-left: 4px solid var(--accent);
}

.ticket-item-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.ticket-subject {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 5px;
}

.ticket-snippet {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 10px;
}

.tag {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
}

.tag-lang {
  background: rgba(255, 255, 255, 0.1);
}

.tag-ai {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

/* --- BİLET DURUMU RENKLERİ --- */
.tag-status {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
}

.tag-status.open {
  background: rgba(245, 158, 11, 0.2);
  /* Sarı (Warning) Arkaplan */
  color: var(--warning);
  /* Sarı Yazı */
}

.tag-status.closed {
  background: rgba(34, 197, 94, 0.2);
  /* Yeşil (Success) Arkaplan */
  color: var(--success);
  /* Yeşil Yazı */
}

/* --- FİLTRE PANELİ TASARIMI --- */
.filter-panel {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 15px;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-panel.hidden {
  display: none;
  /* JS ile açıp kapatacağız */
}

.filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-row select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  outline: none;
  font-size: 0.8rem;
}

/* UYGULANAN FİLTRE UYARI ROZETİ */
.active-filter-badge {
  background: rgba(229, 72, 77, 0.1);
  color: var(--danger);
  font-size: 0.75rem;
  padding: 6px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border: 1px solid rgba(229, 72, 77, 0.3);
  width: 100%;
  transition: all 0.2s;
}

.active-filter-badge:hover {
  background: rgba(229, 72, 77, 0.2);
}

.active-filter-badge.hidden {
  display: none;
}

/* 3. WORKSPACE PANE */
.workspace-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.workspace-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
}

.ticket-info h2 {
  font-size: 1.2rem;
}

.user-contact {
  font-size: 0.85rem;
  color: var(--muted);
}

.btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  color: white;
  gap: 8px;
}

.btn-primary {
  background: var(--accent);
  white-space: nowrap;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background: rgba(229, 72, 77, 0.1);
  color: var(--danger);
  border: 1px solid rgba(229, 72, 77, 0.3);
}

.modal-actions-split {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  width: 100%;
}

.modal-actions-split .btn {
  flex: 1;
  /* Butonları %50 - %50 eşit böler ve sığdırır */
  justify-content: center;
}

.btn-ai {
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  white-space: nowrap;
}

.btn-full-width {
  width: 100%;
  margin-top: 5px;
  justify-content: center;
}

.btn-warning {
  background-color: var(--warning, #f59e0b);
  color: #111827 !important;
  /* Yazıyı koyu yaparak okunabilirliği artırıyoruz */
  border: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-warning:hover {
  background-color: #d97706;
  /* Hover durumunda biraz daha koyu turuncu */
  color: #ffffff !important;
}

/* PASİF BUTON STİLLERİ */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none !important;
}

.btn-ai:disabled {
  background: var(--card);
  /* Canlı rengi grileştir */
  border: 1px solid var(--border);
  color: var(--muted);
}

/* TOAST BİLDİRİM STİLİ */
.toast-message {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--card);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  cursor: pointer;
  font-size: 0.9rem;
  animation: slideInUp 0.4s ease-out;
}

.toast-message:hover {
  background: rgba(59, 130, 246, 0.1);
}

@keyframes slideInUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* CHAT BUBBLES */
.chat-container {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-bubble {
  max-width: 70%;
  padding: 15px;
  border-radius: 12px;
}

.chat-meta {
  font-size: 0.75rem;
  margin-bottom: 8px;
  opacity: 0.7;
}

.chat-text {
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.chat-bubble.user {
  background: var(--card);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.chat-bubble.staff {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  align-self: flex-end;
  border-bottom-right-radius: 2px;
  color: var(--text);
}

/* AI DRAFT BUBBLE */
.chat-bubble.ai-draft {
  background: rgba(245, 158, 11, 0.1);
  border: 1px dashed var(--warning);
  align-self: center;
  width: 90%;
  max-width: 90%;
}

.chat-bubble.ai-draft .chat-meta {
  color: var(--warning);
  font-weight: bold;
}

.draft-actions {
  margin-top: 15px;
  display: flex;
  gap: 10px;
}

.btn-small {
  padding: 5px 10px;
  font-size: 0.8rem;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  color: white;
}

.btn-success {
  background: var(--success);
}

.btn-edit {
  background: var(--muted);
}

/* REPLY BOX */
.reply-box {
  display: none;
  flex-direction: column;
  gap: 15px;
  padding: 20px;
  background: var(--card);
  border-top: 1px solid var(--border);
}

#attachmentPreview {
  display: none;
  padding: 12px 15px;
  background: var(--surface);
  border-radius: 8px;
  justify-content: space-between;
  align-items: center;
  border: 1px dashed var(--accent);
  width: 100%;
}

#attachmentName {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

#btnRemoveAttachment {
  cursor: pointer;
  color: var(--danger);
  font-size: 1.2rem;
}

.reply-container {
  display: flex;
  gap: 15px;
  align-items: stretch;
  width: 100%;
}

.reply-box .reply-tools {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding-right: 5px;
}

#fileAttachInput {
  display: none;
}

#btnAttachFile {
  cursor: pointer;
  font-size: 1.3rem;
}

#replyInput {
  flex: 1;
  resize: none;
}

.reply-box .reply-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

.reply-tools {
  display: flex;
  gap: 15px;
  margin-bottom: 10px;
  color: var(--muted);
  align-items: center;
}

.lang-switcher {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 0.8rem;
}

textarea {
  width: 100%;
  height: 80px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  resize: none;
  font-family: inherit;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.reply-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

/* Alt kısımdaki ikon ve dil seçici hizalaması */
.sidebar-footer .lang-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: transparent;
  border: 1px solid var(--border);
  height: 35px;
  border-radius: 8px;
  cursor: pointer;
  min-width: 70px;
  padding: 0 8px;
}

.sidebar-footer .lang-icon {
  position: absolute;
  left: 10px;
  font-size: 0.9rem;
  color: var(--muted);
  pointer-events: none;
}

.sidebar-footer .language-select {
  width: 100%;
  height: 100%;
  padding: 0 4px 0 26px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  text-align: left;
  text-align-last: left;
}

.sidebar-footer .language-select option {
  background: var(--card);
  color: var(--text);
}

/* RTL (Arapça/Farsça) Desteği */
html[dir="rtl"] .sidebar-footer .lang-icon {
  left: auto;
  right: 10px;
}

html[dir="rtl"] .sidebar-footer .language-select {
  padding: 0 26px 0 4px;
  text-align: right;
  text-align-last: right;
}

/* AI Status Bar - Metin ve İkon Stilleri */
.ai-status-text {
  font-size: 0.85rem;
  font-weight: 500;
}

.ai-model-info {
  display: none;
  /* Başlangıçta gizli, JS ile flex yapılacak */
  align-items: center;
  gap: 8px;
}

.ai-model-icon {
  color: var(--muted);
  font-size: 0.9rem;
}

.ai-model-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.ai-model-text {
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--accent);
}

#aiModelSelect {
  display: none;
  /* Başlangıçta gizli, SuperAdmin ise JS ile block yapılacak */
}

/* AI STATUS BAR */
.ai-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 8px 15px;
  border-radius: 8px;
  margin-bottom: 5px;
}

.ai-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 5px var(--muted);
  transition: all 0.3s;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.status-dot.offline {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

.status-dot.generating {
  background: var(--warning);
  box-shadow: 0 0 10px var(--warning);
  animation: pulse 1s infinite alternate;
}

.ai-model-dropdown {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.8rem;
  outline: none;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  100% {
    transform: scale(1.3);
    opacity: 1;
  }
}

/* SILME BUTONU */
.btn-danger-outline {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}

.btn-danger-outline:hover {
  background: rgba(229, 72, 77, 0.1);
}

/* MODERN MODAL (POP-UP) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  opacity: 1;
  transition: opacity 0.3s;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 25px;
  border-radius: 12px;
  width: 400px;
  max-width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(0);
  transition: transform 0.3s;
}

.modal-overlay.hidden .modal-box {
  transform: translateY(-20px);
}

.modal-box h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.modal-box p {
  color: var(--muted);
  margin-bottom: 25px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* --- CHAT MEDYA (RESİM) STİLLERİ --- */
.chat-media {
  margin-top: 8px;
  margin-bottom: 8px;
}

.ticket-image {
  max-width: 250px;
  /* Maksimum genişlik */
  max-height: 250px;
  /* Maksimum yükseklik */
  border-radius: 8px;
  /* Köşeleri yuvarlat */
  object-fit: cover;
  /* Resmi orantılı bir şekilde kırparak sığdır */
  cursor: pointer;
  /* Üzerine gelince tıklanabilir (el) ikonu çıkar */
  border: 1px solid var(--border);
  /* Hafif bir çerçeve */
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Resmin üzerine fare ile gelince hafifçe büyüsün ve parlasın */
.ticket-image:hover {
  transform: scale(1.02);
  opacity: 0.9;
}

/* Başlangıçta ve bilet seçili değilken yanıt kutusunu gizle */
#replyBox {
  display: none;
}

/* =========================================
   INVITE MODAL ÖZEL STİLLERİ
========================================= */
.invite-modal {
  max-width: 400px;
  text-align: left;
  /* LTR diller için sola dayalı */
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-close-icon {
  cursor: pointer;
  color: var(--muted);
  transition: color 0.2s;
}

.modal-close-icon:hover {
  color: var(--text);
}

.modal-input-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  margin-bottom: 15px;
}

.modal-input-group label {
  font-size: 0.85rem;
  color: var(--muted);
}

.modal-input,
.modal-select {
  width: 100%;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  outline: none;
}

.modal-btn-full {
  width: 100%;
  justify-content: center;
  margin-top: 5px;
}

/* Modala özel Hata ve Başarı kutuları */
.modal-box .error-msg {
  background: rgba(229, 72, 77, 0.1);
  color: var(--danger);
  padding: 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 15px;
  border: 1px solid rgba(229, 72, 77, 0.3);
}

.modal-box .success-msg {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
  padding: 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: 15px;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* =========================================
   STAFF MANAGEMENT (PERSONEL YÖNETİMİ) PANE
========================================= */
.staff-pane {
  flex: 1;
  padding: 20px;
  background: var(--bg);
  overflow-y: auto;
}

.staff-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 15px;
}

.staff-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  margin: 0;
}

.staff-header-icon {
  color: var(--accent);
}

.staff-table-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.staff-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.staff-table thead tr {
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--border);
}

.staff-table th {
  padding: 15px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
}

.staff-table td {
  padding: 15px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text);
  vertical-align: middle;
}

/* Tablonun son satırının alt çizgisini kaldır */
.staff-table tbody tr:last-child td {
  border-bottom: none;
}

.staff-table-actions {
  text-align: right;
}

.staff-loading-cell {
  padding: 30px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* --- GENEL GİZLEME SINIFI --- */
.hidden {
  display: none !important;
}

/* =========================================
   ANNOUNCEMENTS (ANONS) PANE STİLLERİ
========================================= */
.announcements-pane {
  flex: 1;
  padding: 20px;
  background: var(--bg);
  overflow-y: auto;
}

.announcements-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 25px;
  max-width: 800px;
}

.announcements-desc {
  color: var(--muted);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.announce-input-group {
  margin-bottom: 20px;
}

.announce-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.announce-textarea {
  width: 100%;
  resize: vertical;
  padding: 15px;
  font-family: inherit;
  min-height: 150px;
}

.announce-action-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 15px;
}

.announce-template-select {
  flex: 1; /* Dropdown alanı kalan boşluğu doldursun */
  margin: 0;
}

/* =========================================
   JS İLE OLUŞTURULAN TABLO BUTON STİLLERİ
========================================= */
.staff-role-select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px;
  margin-right: 5px;
  outline: none;
  font-size: 0.8rem;
}

.btn-action-sm {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  margin-left: 5px;
}

.btn-status-disable {
  color: var(--warning);
}

.btn-status-enable {
  color: var(--success);
}

/* =========================================
   HESAP AYARLARI (ACCOUNT SETTINGS) & PROFİL
========================================= */

/* Sol menü altındaki profil butonları */
.profile-action-icon {
  cursor: pointer;
  margin-right: 15px;
  color: var(--muted);
  transition: color 0.3s ease;
}

.profile-action-icon:hover {
  color: var(--text);
}

.profile-logout-icon {
  cursor: pointer;
  color: var(--muted);
  transition: color 0.3s ease;
}

.profile-logout-icon:hover {
  color: var(--danger);
}

/* Modal Özelleştirmeleri */
.modal-settings {
  max-width: 500px;
}

.settings-section {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.settings-title {
  margin-bottom: 15px;
  color: var(--text);
  font-size: 1rem;
}

.settings-icon-tg {
  color: #0088cc;
  margin-right: 8px;
}

.settings-icon-lock {
  color: var(--warning);
  margin-right: 8px;
}

.settings-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 15px;
}

.input-wrapper {
  position: relative;
}

.input-wrapper i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.input-wrapper input {
  padding-left: 35px;
}

/* Staff Broadcast Role Checkboxes */
.role-filters {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--primary);
  cursor: pointer;
}

/* Telegram Action Icon in Table */
.action-icon.tg-active {
  color: #0088cc;
  cursor: pointer;
}

.action-icon.tg-active:hover {
  color: #005f8e;
}

.action-icon.tg-disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.5;
}

/* Başlıklar ve İkonlar */
.broadcast-section-title {
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.broadcast-section-icon {
  color: var(--primary);
  margin-right: 8px;
}

/* Bölümler Arası Ayırıcı */
.broadcast-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 30px 0;
}

/* Staff Rol Seçici Checkbox'lar */
.role-filters {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--primary);
  cursor: pointer;
}

/* Telegram Verification Modal Genişlik Düzeltmesi */
.input-wrapper {
  width: 100%;
  display: block;
}

.input-wrapper input.modal-input {
  width: 100%;
  box-sizing: border-box;
}

/* =========================================
   AVATAR SEÇİCİ (ICON PICKER)
========================================= */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.avatar-option {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: 12px;
  height: 50px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-option:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.avatar-option.selected {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
}

/* Sol alttaki mevcut avatarı tıklanabilir yapma */
.staff-avatar {
  width: 40px;
  height: 40px;
  background-color: var(--primary, #3b82f6);
  /* Senin gördüğün o mavi yuvarlak */
  color: #ffffff !important;
  /* İKONUN KESİNLİKLE BEYAZ VE GÖRÜNÜR OLMASINI SAĞLAR */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

/* İçine giren ikonun (.fas) tam ortalanması ve boyutu */
.staff-avatar i {
  font-size: 1.3rem;
  line-height: 1;
  color: #ffffff;
}

.staff-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

/* =========================================
   SADECE "BULL" KULLANICISI İÇİN ÖZEL BOĞA (TAURUS) RENGİ
========================================= */
.staff-avatar i.fa-taurus {
  color: #ff3333 !important;
  text-shadow: 0 0 10px rgba(255, 51, 51, 0.7), 0 0 25px rgba(255, 51, 51, 0.3) !important;
}

/* =========================================
   FİNANS VE İSTATİSTİK BÖLÜMÜ
========================================= */
.finance-pane {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg);
  padding: 20px;
}

.finance-container {
  padding: 0;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.stat-icon {
  width: 55px;
  height: 55px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: rgba(255, 255, 255, 0.05);
}

.icon-success {
  color: var(--success);
}

.icon-danger {
  color: var(--danger);
}

.icon-warning {
  color: var(--warning);
}

.stat-info h3 {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 5px;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 25px;
}

.finance-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.finance-card h3 {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: var(--text);
  font-weight: 600;
}

.chart-wrapper {
  position: relative;
  height: 300px;
  width: 100%;
}

.badge-protected {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Mobil / Küçük Ekran Uyumluluğu */
@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   MÜŞTERİ PROFİL MODALI (UX)
========================================= */
.modal-md {
  max-width: 550px !important;
}

.user-profile-layout {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
}

.profile-stat-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-stat-box span {
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-stat-box strong {
  color: var(--text);
  font-size: 1.1rem;
}

.profile-table-container {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Geniş veriler için Büyük Modal Sınıfı */
.modal-lg {
  max-width: 1150px !important;
  width: 95%;
}

/* 2 Sütunlu Grid Sistemi */
.profile-stats-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 15px;
}

/* Uzun metinlerin kutuyu bozmasını engeller */
.profile-stat-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  /* Etiket ve değer arasına güvenli boşluk */
}

.profile-stat-box span {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
  /* Etiket (Sol taraf) her zaman tek satır kalsın */
}

.profile-stat-box strong {
  color: var(--text);
  font-size: 1rem;
  text-align: right;
  word-break: break-word;
  /* Çok uzun verileri taşırmak yerine alt satıra atar */
}

/* Kuyruktaki Paket (Next Plan) Kutusunun 2 sütunu birden kaplaması için */
.stat-box-full {
  grid-column: 1 / -1;
  background: rgba(59, 130, 246, 0.05) !important;
  border-color: rgba(59, 130, 246, 0.2) !important;
}

/* Tablo sütunları için hizalama sınıfları */
.text-center {
  text-align: center;
}

/* Tablodaki tarih sütunlarının ezilmesini önler */
.col-date {
  white-space: nowrap;
  min-width: 130px;
  font-size: 0.8rem;
  color: var(--muted);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

/* Proxy Offline Banner */
.proxy-offline-banner {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  padding: 12px 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 15px;
}

/* Mobil cihazlarda ekran daralırsa tekrar tek sütuna düşmesi için (Responsive) */
@media (max-width: 768px) {
  .profile-stats-grid-2col {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   CUSTOMER MANAGEMENT
========================================= */
.customer-search-box {
  display: flex;
  position: relative;
  gap: 15px;
  margin-top: 10px;
  margin-bottom: 30px;
  max-width: 600px;
}

.customer-search-box input {
  flex: 1;
}

.section-title {
  font-size: 1.1rem;
  color: var(--text);
  margin-top: 30px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 300px; /* Sadece input'un altını kaplasın */
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    list-style: none;
    padding: 0;
    margin: 5px 0 0 0;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
}

.autocomplete-dropdown li {
    padding: 10px 15px;
    cursor: pointer;
    color: var(--text);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
    font-size: 0.9rem;
}

.autocomplete-dropdown li:last-child {
    border-bottom: none;
}

.autocomplete-dropdown li:hover {
    background: rgba(14, 165, 233, 0.1);
    color: var(--accent);
}

.autocomplete-highlight {
    color: var(--accent);
    font-weight: bold;
}

/* =========================================
   TELEGRAM DM (MÜŞTERİ) STİLLERİ
========================================= */
.btn-tg {
  background-color: rgba(0, 136, 204, 0.1);
  color: #0088cc;
  border: 1px solid rgba(0, 136, 204, 0.3);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-inline-start: 15px; /* RTL uyumlu otomatik boşluk! */
}

.btn-tg:hover:not(:disabled) {
  background-color: #0088cc;
  color: #fff;
}

/* Telegram bağlı değilse buton pasif olur */
.btn-tg:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(100%);
}

/* Modal text alanı genişliği için */
.textarea-lg {
  height: 120px;
  resize: none;
}

/* CUSTOMER STATISTICS MODAL STYLES */
.stats-grid-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.stats-grid-half {
  grid-template-columns: repeat(2, 1fr);
}

.stat-card-ui {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  transition: transform 0.2s;
}

.stat-card-ui:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.stat-card-ui .stat-value {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--accent);
  margin: 10px 0;
}

.stat-card-ui .stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.stat-section-title {
  margin-bottom: 12px;
  color: var(--text);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  font-size: 1rem;
}

.lang-stats-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.lang-badge {
  background: rgba(14, 165, 233, 0.1);
  color: #0ea5e9;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: bold;
  border: 1px solid rgba(14, 165, 233, 0.2);
}

/* =========================================
   GENEL UYARI MODALI (ALERT BİLDİRİMLERİ)
========================================= */
.alert-modal-box {
  max-width: 400px !important;
  text-align: center;
}

.alert-modal-header {
  justify-content: center;
  border-bottom: none;
  padding-bottom: 0;
}

.alert-icon {
  color: var(--danger);
  font-size: 1.5rem;
  margin-right: 8px;
}

.alert-modal-desc {
  margin-top: 15px;
  margin-bottom: 25px;
  font-size: 1rem;
  color: var(--text);
}

.alert-modal-actions {
  display: flex;
  justify-content: center;
}

/* =========================================
   MÜDAHALE (ACTION) BUTONLARI VE MODALLAR
========================================= */
.btn-action-icon {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  margin-inline-start: 10px;
  transition: color 0.3s ease;
}

.btn-action-icon:hover {
  color: var(--accent);
}

.btn-gift-header {
  background-color: rgba(245, 158, 11, 0.1);
  /* Turuncu/Sarı Hediye Tonu */
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-inline-start: 15px;
}

.btn-gift-header:hover {
  background-color: #f59e0b;
  color: #fff;
}

/* Tablodaki Onay (Check) Butonu */
.btn-force-paid {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-force-paid:hover {
  background: var(--success);
  color: #fff;
}

/* =========================================
   TOAST NOTIFICATION STYLES (SUPPORT PANEL)
========================================= */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-secondary, #1e293b);
  /* Kendi panel renklerine göre ayarlanabilir */
  color: var(--text, #f8fafc);
  padding: 14px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 500;
  border-left: 4px solid #3b82f6;
  /* Default info rengi */
  animation: slideIn 0.3s ease-out forwards;
  min-width: 250px;
}

.toast.success {
  border-left-color: #10b981;
  /* Başarılı yeşili */
}

.toast.error {
  border-left-color: #ef4444;
  /* Hata kırmızısı */
}

/* Animasyonlar */
@keyframes slideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* =========================================
   SYSTEM LOGS & STATUS PANE
========================================= */
.logs-pane {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  padding: 20px;
}

.logs-tabs-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
}

.logs-tabs-nav {
  display: flex;
  gap: 10px;
  border-bottom: 2px solid var(--border);
  width: 100%;
  padding-bottom: 10px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  padding: 10px 15px;
  cursor: pointer;
  transition: color 0.3s, border-bottom 0.3s;
  position: relative;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--accent);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
}

.log-tab-content {
  flex: 1;
  padding-top: 20px;
}

/* STATUS GRID CARDS */
.status-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.status-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s;
}

.status-card:hover {
  transform: translateY(-3px);
  z-index: 50;
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.status-title {
  font-weight: 600;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-icon {
  color: var(--muted);
  font-size: 1.2rem;
}

.led-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  cursor: pointer;
}

.led-indicator.online {
  background-color: var(--success);
  box-shadow: 0 0 10px var(--success);
}

.led-indicator.warning {
  background-color: var(--warning);
  box-shadow: 0 0 10px var(--warning);
}

.led-indicator.offline {
  background-color: var(--danger);
  box-shadow: 0 0 10px var(--danger);
}

.led-tooltip {
  visibility: hidden;
  opacity: 0;
  width: max-content !important;
  min-width: 150px;
  background-color: #000;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px 12px;
  position: absolute;
  z-index: 999;
  bottom: 150%;
  right: -8px;
  font-size: 0.75rem;
  white-space: nowrap;
  transition: opacity 0.3s;
}

.led-indicator:hover .led-tooltip {
  visibility: visible;
  opacity: 1;
}

.led-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 10px;
  border-width: 5px;
  border-style: solid;
  border-color: #000 transparent transparent transparent;
}

/* LOG TABLE BADGES */
.badge-level {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: bold;
}

.badge-level.info {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-level.warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-level.error,
.badge-level.critical {
  background: rgba(229, 72, 77, 0.1);
  color: var(--danger);
  border: 1px solid rgba(229, 72, 77, 0.3);
}

/* TERMINAL (LIVE STREAM) */
.terminal-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1a2e;
  padding: 10px 20px;
  border-radius: 10px 10px 0 0;
  border: 1px solid #0f3460;
}

.terminal-actions {
  display: flex;
  gap: 10px;
}

/* Terminal Clear butonu Light Mode'da da siyah arkaplanda düzgün görünsün */
.terminal-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}
.terminal-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

.terminal-window {
  background: #0b0c10;
  border: 1px solid #0f3460;
  border-top: none;
  border-radius: 0 0 10px 10px;
  height: 500px;
  padding: 15px;
  overflow-y: auto;
}

.terminal-output {
  font-family: 'Courier New', Courier, monospace;
  color: #45f3ff;
  font-size: 0.9rem;
  white-space: pre-wrap;
  line-height: 1.4;
  margin: 0;
}

/* =========================================
   RTL (SAĞDAN SOLA - AR, FA) DESTEĞİ
========================================= */
html[dir="rtl"] .sidebar {
  border-right: none;
  border-left: 1px solid var(--border);
}

html[dir="rtl"] .ticket-list-pane {
  border-right: none;
  border-left: 1px solid var(--border);
}

html[dir="rtl"] .ticket-item.active {
  border-left: none;
  border-right: 4px solid var(--accent);
}

/* Chat Baloncukları Yön ve Kavis Çevirmesi */
html[dir="rtl"] .chat-bubble.user {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 2px;
}

html[dir="rtl"] .chat-bubble.staff {
  border-bottom-right-radius: 12px;
  border-bottom-left-radius: 2px;
}

/* İkonlar ve boşluk düzeltmeleri */
html[dir="rtl"] .sidebar-footer .lang-wrapper {
  flex-direction: row;
}

html[dir="rtl"] .reply-tools {
  flex-direction: row;
}

html[dir="rtl"] .active-filter-badge i {
  margin-right: auto;
  margin-left: 0;
}

/* Modal RTL Düzeltmeleri */
html[dir="rtl"] .invite-modal {
  text-align: right;
}

html[dir="rtl"] .modal-input-group {
  align-items: flex-start;
}

html[dir="rtl"] .staff-table {
  text-align: right;
}

html[dir="rtl"] .staff-table-actions {
  text-align: left;
}

/* STAFF MANAGEMENT & ANNOUNCEMENTS RTL düzeltmeleri */
html[dir="rtl"] .staff-header-title .staff-header-icon {
  margin-right: 0;
  margin-left: 10px;
}

html[dir="rtl"] .staff-table th,
html[dir="rtl"] .staff-table td {
  text-align: right;
}

html[dir="rtl"] .staff-table-actions {
  text-align: left;
}

html[dir="rtl"] .staff-role-select {
  margin-right: 0;
  margin-left: 5px;
}

html[dir="rtl"] .btn-action-sm {
  margin-left: 0;
  margin-right: 5px;
}

html[dir="rtl"] .announcements-desc,
html[dir="rtl"] .announce-label,
html[dir="rtl"] .announce-textarea {
  text-align: right;
}

html[dir="rtl"] .profile-action-icon {
  margin-right: 0;
  margin-left: 15px;
}

html[dir="rtl"] .settings-icon-tg,
html[dir="rtl"] .settings-icon-lock {
  margin-right: 0;
  margin-left: 8px;
}

html[dir="rtl"] .settings-desc {
  text-align: right;
}

html[dir="rtl"] .input-wrapper i {
  left: auto;
  right: 12px;
}

html[dir="rtl"] .input-wrapper input {
  padding-left: 15px;
  padding-right: 35px;
}

html[dir="rtl"] .checkbox-label {
  gap: 0;
  padding-left: 5px;
}

html[dir="rtl"] .checkbox-label input {
  margin-left: 5px;
}

html[dir="rtl"] .broadcast-section-icon {
  margin-right: 0;
  margin-left: 8px;
}

html[dir="rtl"] .checkbox-label {
  gap: 0;
  padding-left: 5px;
}

html[dir="rtl"] .checkbox-label input {
  margin-left: 5px;
}

html[dir="rtl"] .logs-tabs-header {
  align-items: flex-end;
}

html[dir="rtl"] .terminal-toolbar {
  flex-direction: row-reverse;
}

html[dir="rtl"] .terminal-output {
  text-align: left;
  /* Terminal yazıları kod olduğu için LTR kalmalı */
  direction: ltr;
}

html[dir="rtl"] .announce-action-row {
  flex-direction: row-reverse;
}

/* =========================================
   HELP GUIDE (KNOWLEDGE BASE) STYLES
========================================= */
#help-guide-container {
  display: flex;
  flex: 1;
  height: 100vh;
  background-color: var(--bg);
  overflow: hidden;
}

.guide-toc {
  width: 320px;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 25px 15px;
  overflow-y: auto;
}

html[dir="rtl"] .guide-toc {
  border-right: none;
  border-left: 1px solid var(--border);
}

.guide-toc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 25px;
  padding-left: 10px;
}

html[dir="rtl"] .guide-toc-header {
  padding-left: 0;
  padding-right: 10px;
}

.guide-menu-list {
  list-style: none;
}

/* Ana Menü Elemanları */
.guide-menu-item {
  padding: 12px 15px;
  margin-bottom: 8px;
  cursor: pointer;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
}

.guide-menu-item i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
  transition: transform 0.3s ease;
}

.guide-menu-item:hover {
  background: rgba(59, 130, 246, 0.08);
  color: var(--text);
  border-color: rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}

.guide-menu-item:hover i {
  transform: scale(1.1);
}

.guide-menu-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
  border-left: 4px solid var(--accent);
}

html[dir="rtl"] .guide-menu-item.active {
  border-left: none;
  border-right: 4px solid var(--accent);
}

.guide-content-area {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  background: var(--bg);
}

.guide-section {
  max-width: 900px;
  margin: 0 auto;
  animation: slideInUp 0.4s ease-out;
}

.guide-section-header {
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.guide-section-header h2 {
  font-size: 1.8rem;
  color: var(--text);
  margin-bottom: 10px;
}

.guide-section-header p {
  color: var(--muted);
  font-size: 1rem;
}

/* KART TASARIMLARI */
.guide-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.guide-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1.2rem;
  margin-bottom: 15px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 10px;
}

.guide-card h3 i {
  color: var(--accent);
}

.guide-card p, .guide-card ul {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 15px;
}

.guide-card ul {
  padding-left: 20px;
}

html[dir="rtl"] .guide-card ul {
  padding-left: 0;
  padding-right: 20px;
}

.guide-card li {
  margin-bottom: 8px;
  color: var(--muted);
}

.guide-card li strong {
  color: var(--text);
}

/* UYARI KUTULARI (ALERTS) */
.guide-alert {
  background: rgba(245, 158, 11, 0.1);
  border-left: 4px solid var(--warning);
  padding: 15px;
  border-radius: 0 8px 8px 0;
  margin: 15px 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

html[dir="rtl"] .guide-alert {
  border-left: none;
  border-right: 4px solid var(--warning);
  border-radius: 8px 0 0 8px;
}

.guide-alert-title {
  color: var(--warning);
  font-weight: bold;
  margin-bottom: 5px;
  display: block;
}

/* EKRAN GÖRÜNTÜSÜ ALANLARI */
.guide-image-wrapper {
  text-align: center;
  margin: 20px 0;
  background: var(--card);
  padding: 15px;
  border-radius: 8px;
  border: 1px dashed var(--border);
}

.guide-image-wrapper img {
  max-width: 100%;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.guide-image-caption {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 10px;
}

/* Alt Menü (Sub-menu) Stilleri */
.guide-sub-menu {
  list-style: none;
  padding-left: 0;
  margin-top: -5px;
  margin-bottom: 20px;
  margin-left: 32px;
  border-left: 1px solid var(--border); /* Kılavuz Çizgisi */
}

html[dir="rtl"] .guide-sub-menu {
  margin-left: 0;
  margin-right: 32px;
  border-left: none;
  border-right: 1px solid var(--border);
}

.guide-sub-item {
  position: relative;
  padding: 8px 15px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-radius: 0 6px 6px 0;
  transition: all 0.3s ease;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
}

/* Çizgi Üzerindeki Animasyonlu Nokta */
.guide-sub-item::before {
  content: '';
  position: absolute;
  left: -4px; /* Çizginin tam üstüne oturur */
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s ease;
}

html[dir="rtl"] .guide-sub-item::before {
  left: auto;
  right: -4px;
}

/* Hover Animasyonları */
.guide-sub-item:hover {
  color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
  transform: translateX(4px); /* Sağa hafifçe kayma efekti */
}

html[dir="rtl"] .guide-sub-item:hover {
  transform: translateX(-4px);
}

.guide-sub-item:hover::before {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transform: translateY(-50%) scale(1.3);
}

/* Tıklandığında (Aktif Olduğunda) Geçerli Olacak Stil */
.guide-sub-item.active {
  color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
  font-weight: 600;
}

.guide-sub-item.active::before {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  height: 14px;
  border-radius: 4px;
}

/* =========================================
   RESİM BOYUTLANDIRMA VE LIGHTBOX
========================================= */

/* Desktop resimler: Alanın %100'ünü kaplar, hafif kenarlık */
.img-desktop {
  width: 100%;
  border: 1px solid var(--border);
}

/* Mobil resimler: Telefon gibi dar, kalın kenarlıklı ve ortalanmış */
.img-mobile {
  max-width: 320px !important;
  height: auto;
  margin: 0 auto;
  display: block;
  border-radius: 16px !important;
  border: 6px solid var(--card) !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Tıklanabilir (Büyüteç) İmleci ve Hover Efekti */
.role-based-img {
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.role-based-img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* Lightbox Modal Tasarımı */
#imageViewerModal {
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  cursor: zoom-out;
}

.image-viewer-box {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.image-viewer-box img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

.viewer-close-icon {
  position: absolute;
  top: -30px;
  right: -30px;
  color: var(--muted);
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.2s;
}

.viewer-close-icon:hover {
  color: var(--danger);
}

@media (max-width: 768px) {
  .viewer-close-icon {
    top: -40px;
    right: 0;
  }
}