/* ==========================================================================
   SosyalBozum İşlemler Paneli — özel yönetim paneli teması.
   Sol sabit menü + üst çubuk + renkli özet kartları düzeni (Material esintili).
   Bu dosya SADECE bu izole panel içindir, ana siteyle paylaşılmaz.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;

  /* Marka renkleri */
  --brand-1: #e23a63;      /* pembemsi kırmızı */
  --brand-2: #ff7a45;      /* turuncu */
  --brand-3: #8b3aef;      /* mor (gradient için) */

  /* Yüzeyler */
  --surface: #f1f2f8;
  --card-bg: #ffffff;
  --sidebar-bg: #1c1726;
  --sidebar-bg-soft: #241d33;
  --line: #e7e6ef;
  --line-soft: rgba(28, 23, 38, 0.07);

  /* Metin */
  --ink: #221c30;
  --admin-text-soft: #857f92;
  --ink-invert: #f4f2fb;

  /* Ton renkleri (istatistik kartları) */
  --tone-violet: #ee3f63;
  --tone-violet-soft: #fdeaef;
  --tone-gold: #f2a730;
  --tone-gold-soft: #fdf1de;
  --tone-mint: #1bb787;
  --tone-mint-soft: #e2f8f0;
  --tone-coral: #1aa6c9;
  --tone-coral-soft: #e2f5fa;

  /* Anlam renkleri */
  --success: #1bb787;
  --success-soft: #e5f8f0;
  --error: #e0433f;
  --error-soft: #fdeceb;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 2px 4px rgba(28, 23, 38, 0.04), 0 10px 24px -12px rgba(28, 23, 38, 0.12);
  --shadow-pop: 0 18px 40px -14px rgba(28, 23, 38, 0.28);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body.admin-body {
  background: var(--surface);
  color: var(--ink);
  font-family: 'Inter', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: 'Poppins', 'Inter', sans-serif; margin: 0; }
p { margin: 0; }
input, select, textarea, button { font-family: inherit; }

/* ---------- Kaydırma çubuğu (ince, panel havasına uygun) ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(28,23,38,0.18); border-radius: 999px; }

/* ==========================================================================
   Genel iskelet: sabit sol menü + sağda üst çubuk/içerik sütunu
   ========================================================================== */

.admin-shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

/* ---------- Sol menü ---------- */
.admin-sidebar {
  width: 264px;
  flex: 0 0 264px;
  background: var(--sidebar-bg);
  color: var(--ink-invert);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
  transition: transform .25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 22px 18px;
}
.sidebar-brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 17px; color: #fff;
}
.sidebar-brand-word {
  font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 15.5px;
  letter-spacing: .01em; color: #fff;
}
.sidebar-brand-logo { display: block; max-height: 34px; max-width: 200px; width: auto; }

.sidebar-user {
  position: relative;
  margin: 0 16px 18px;
  padding: 18px 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255,122,69,.55), transparent 55%),
    radial-gradient(130% 150% at 100% 0%, rgba(139,58,239,.5), transparent 60%),
    linear-gradient(120deg, var(--brand-1), #7a2fd6 65%, var(--brand-3));
  display: flex; align-items: center; gap: 12px;
}
.sidebar-user-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: rgba(255,255,255,0.22);
  border: 1.5px solid rgba(255,255,255,0.55);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: #fff;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-info strong { display: block; font-size: 13.5px; color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-info span { display: block; font-size: 11.5px; color: rgba(255,255,255,0.82); margin-top: 2px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 12px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: rgba(244,242,251,0.72); font-size: 13.5px; font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .15s ease, color .15s ease;
}
.sidebar-nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav a.active {
  background: linear-gradient(90deg, rgba(226,58,99,0.28), rgba(226,58,99,0.05));
  color: #fff;
  border-left-color: var(--brand-2);
}
.sidebar-nav a.active svg { opacity: 1; color: var(--brand-2); }

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px 22px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column; gap: 12px;
}
.sbi-panel-badge {
  display: inline-flex; align-items: center; gap: 6px; width: fit-content;
  background: rgba(255,215,106,0.12); color: #ffd76a;
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em;
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid rgba(255,215,106,0.25);
}
.sbi-panel-badge svg { width: 12px; height: 12px; }
.sidebar-logout {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: rgba(244,242,251,0.72); font-weight: 500;
  padding: 8px 4px;
}
.sidebar-logout svg { width: 17px; height: 17px; }
.sidebar-logout:hover { color: #fff; }

/* ---------- Sağ sütun: üst çubuk + içerik ---------- */
.admin-content-col { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

.admin-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 28px;
  height: 64px; flex: none;
  background: linear-gradient(100deg, var(--brand-1), var(--brand-2) 130%);
  position: sticky; top: 0; z-index: 30;
  box-shadow: 0 6px 20px -8px rgba(226,58,99,0.45);
}
.admin-topbar-top,
.admin-topbar-nav { display: none; } /* eski üst-menü düzeninden kalan sınıflar artık kullanılmıyor */

.sidebar-toggle {
  display: none;
  background: rgba(255,255,255,0.16); border: none; color: #fff;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  align-items: center; justify-content: center; cursor: pointer; flex: none;
}
.sidebar-toggle svg { width: 19px; height: 19px; }

.admin-topbar-badge {
  color: #fff; font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 13.5px;
  letter-spacing: .02em; opacity: .95;
  display: flex; align-items: center; gap: 8px;
}

.admin-topbar-user { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.user-chip {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,0.16);
  padding: 6px 14px 6px 6px; border-radius: 999px;
}
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,0.9); color: var(--brand-1);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; flex: none;
}
.user-name { color: #fff; font-size: 13px; font-weight: 600; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.16); color: #fff; border: none; cursor: pointer;
  transition: background .15s ease;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: rgba(255,255,255,0.3); }
.icon-btn.danger { background: var(--error-soft); color: var(--error); }
.icon-btn.danger:hover { background: var(--error); color: #fff; }
/* admin-table içindeki icon-btn'ler açık zeminde durur, koyulukları farklı olmalı */
.admin-table .icon-btn { background: var(--surface); color: var(--ink); }
.admin-table .icon-btn:hover { background: var(--line); }
.row-actions .icon-btn.danger { background: var(--error-soft); color: var(--error); }

.admin-main { flex: 1; padding: 28px 32px 60px; max-width: 1180px; width: 100%; margin: 0 auto; }

.admin-header { margin-bottom: 22px; }
.admin-header h1 { font-size: 22px; font-weight: 700; color: var(--ink); }
.admin-header p { margin-top: 5px; font-size: 13.5px; color: var(--admin-text-soft); }

/* ==========================================================================
   Kartlar / genel bileşenler
   ========================================================================== */

.admin-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line-soft);
}
.admin-card h2 {
  font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 9px;
  margin-bottom: 6px;
}
.admin-card h2 svg { width: 18px; height: 18px; color: var(--brand-1); flex: none; }
.card-desc { color: var(--admin-text-soft); font-size: 13px; margin-bottom: 14px; line-height: 1.6; }
.hint { color: var(--admin-text-soft); font-size: 12px; font-weight: 400; }

.card-grid { display: grid; gap: 18px; margin-bottom: 20px; }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .card-grid.cols-3 { grid-template-columns: 1fr; } }

.stat-card { display: flex; align-items: center; gap: 16px; }
.stat-icon {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.stat-icon svg { width: 21px; height: 21px; }
.stat-value { font-family: 'Poppins', sans-serif; font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--admin-text-soft); margin-top: 3px; }
.stat-label .hint { text-transform: none; letter-spacing: 0; }

.stat-card.tone-violet .stat-icon { background: linear-gradient(135deg, var(--tone-violet), #ff6f91); }
.stat-card.tone-gold   .stat-icon { background: linear-gradient(135deg, var(--tone-gold), #ffcf6b); }
.stat-card.tone-mint   .stat-icon { background: linear-gradient(135deg, var(--tone-mint), #4fd8ac); }
.stat-card.tone-coral  .stat-icon { background: linear-gradient(135deg, var(--tone-coral), #57cbe9); }

.quick-link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.quick-link {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 16px; border-radius: var(--radius-md);
  border: 1px solid var(--line); background: var(--card-bg);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.quick-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); border-color: transparent; }
.quick-link-icon {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  background: var(--tone-violet-soft); color: var(--brand-1);
  display: flex; align-items: center; justify-content: center;
}
.quick-link-icon svg { width: 19px; height: 19px; }
.quick-link-body { min-width: 0; flex: 1; }
.quick-link-body h3 { font-size: 13.5px; font-weight: 600; }
.quick-link-body p { font-size: 12px; color: var(--admin-text-soft); margin-top: 2px; }
.quick-link-arrow { color: var(--admin-text-soft); flex: none; }
.quick-link-arrow svg { width: 16px; height: 16px; }
.quick-link:hover .quick-link-arrow { color: var(--brand-1); }

/* ==========================================================================
   Tablolar
   ========================================================================== */

.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.admin-table thead th {
  text-align: left; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--admin-text-soft);
  padding: 0 14px 10px; border-bottom: 1.5px solid var(--line);
  white-space: nowrap;
}
.admin-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.admin-table tbody tr:hover td { background: rgba(226,58,99,0.03); }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table td.num, .admin-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.amount-pos { color: var(--success); font-weight: 600; }
.amount-neg { color: var(--error); font-weight: 600; }

/* ==========================================================================
   Liste satırları (çalışanlar / etiketler)
   ========================================================================== */

.item-list { display: flex; flex-direction: column; gap: 14px; }
.item-row { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.item-row-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.drag-badge { font-weight: 600; font-size: 13.5px; }
.badge-pill { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }

/* ==========================================================================
   Formlar
   ========================================================================== */

.form-row { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="date"],
.form-row input[type="file"],
.form-row select,
.form-row textarea {
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 13.5px; color: var(--ink);
  background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
  width: 100%;
}
.form-row textarea { resize: vertical; min-height: 90px; font-family: inherit; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(226,58,99,0.14);
}

.form-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; }
@media (max-width: 720px) {
  .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
}

.search-row { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.search-row input { flex: 1; min-width: 200px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13.5px; }

.date-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.range-pill {
  padding: 8px 15px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
}
.range-pill.active, .btn.range-pill.active {
  background: linear-gradient(100deg, var(--brand-1), var(--brand-2));
  color: #fff; border-color: transparent;
}
.custom-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.custom-range input[type="date"] { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 7px 10px; font-size: 12.5px; }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ==========================================================================
   Butonlar
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 999px; font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(100deg, var(--brand-1), var(--brand-2));
  color: #fff; box-shadow: 0 10px 22px -10px rgba(226,58,99,0.55);
}
.btn-primary:hover { box-shadow: 0 14px 26px -10px rgba(226,58,99,0.65); }
.btn-outline { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-outline:hover { border-color: var(--brand-1); color: var(--brand-1); }
.btn-danger { background: var(--error-soft); color: var(--error); }
.btn-danger:hover { background: var(--error); color: #fff; }
.btn-link { background: none; border: none; }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-lg { padding: 13px 26px; font-size: 14px; }
.btn-block { width: 100%; }

/* ==========================================================================
   Uyarılar
   ========================================================================== */

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; font-weight: 500; }
.alert-success { background: var(--success-soft); color: #0d7a56; }
.alert-error { background: var(--error-soft); color: #b8302c; }

/* ==========================================================================
   Giriş / kurulum sayfası
   ========================================================================== */

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(120% 120% at 15% 10%, rgba(255,122,69,.35), transparent 55%),
    radial-gradient(120% 130% at 100% 100%, rgba(139,58,239,.4), transparent 55%),
    linear-gradient(160deg, #1c1726, #241d33 60%, #2b1d3d);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--card-bg);
  border-radius: 20px; padding: 34px 30px; box-shadow: var(--shadow-pop);
}
.login-card .logo { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.login-card .logo-word { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 17px; }
.login-card h1 { font-size: 19px; font-weight: 700; margin-bottom: 6px; }
.login-card .sub { display: block; color: var(--admin-text-soft); font-size: 13px; margin-bottom: 18px; line-height: 1.6; }
.login-tabs { margin-bottom: 18px; }

/* ==========================================================================
   Giriş sayfası — profesyonel iki sütunlu düzen (marka paneli + form).
   install.php eski .login-wrap/.login-card ile sade tek kart olarak kalır;
   bu blok yalnızca login.php'nin yeni .auth-* sınıflarını hedefler.
   ========================================================================== */

.auth-shell { min-height: 100vh; display: flex; }

.auth-brand {
  flex: 0 0 42%; max-width: 540px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 56px 52px; color: var(--ink-invert);
  background:
    radial-gradient(130% 130% at 15% 0%, rgba(255,122,69,.32), transparent 55%),
    radial-gradient(130% 140% at 100% 100%, rgba(139,58,239,.45), transparent 55%),
    linear-gradient(165deg, #1c1726, #241d33 55%, #2b1d3d);
}
.auth-brand-top { position: relative; z-index: 1; }
.auth-brand-mark { margin-bottom: 30px; }
.auth-brand-mark img { display: block; max-height: 52px; max-width: 230px; }
.auth-brand-letter {
  width: 60px; height: 60px; border-radius: 16px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 24px; color: #fff;
  box-shadow: 0 16px 32px -14px rgba(226,58,99,.6);
}
.auth-brand h1 {
  font-family: 'Poppins', sans-serif; font-size: 30px; font-weight: 700;
  line-height: 1.28; margin-bottom: 14px; text-wrap: balance;
}
.auth-lead { font-size: 14.5px; line-height: 1.7; color: rgba(244,242,251,0.72); max-width: 360px; }
.auth-points { list-style: none; display: flex; flex-direction: column; gap: 16px; margin-top: 36px; position: relative; z-index: 1; }
.auth-points li { display: flex; align-items: flex-start; gap: 12px; font-size: 13.5px; color: rgba(244,242,251,0.85); }
.auth-points li svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--brand-2); }
.auth-brand-bottom { position: relative; z-index: 1; margin-top: 36px; }

.auth-form-side {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: var(--surface); padding: 32px 24px;
}
.auth-card {
  width: 100%; max-width: 380px; background: var(--card-bg);
  border: 1px solid var(--line-soft); border-radius: 20px;
  padding: 38px 34px; box-shadow: var(--shadow-card);
}
.auth-card h1 { font-size: 21px; font-weight: 700; margin-bottom: 6px; }
.auth-card .sub { display: block; color: var(--admin-text-soft); font-size: 13px; margin-bottom: 22px; line-height: 1.6; }

.auth-tabs { display: flex; gap: 4px; background: var(--surface); padding: 4px; border-radius: 12px; margin-bottom: 24px; }
.auth-tab {
  flex: 1; text-align: center; padding: 9px 10px; border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--admin-text-soft);
  text-decoration: none; transition: background .15s ease, color .15s ease;
}
.auth-tab.active { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(28,23,38,.12); }
.auth-tab:not(.active):hover { color: var(--ink); }

@media (max-width: 900px) {
  .auth-shell { flex-direction: column; }
  .auth-brand { max-width: none; padding: 34px 26px; }
  .auth-points { display: none; }
  .auth-brand-bottom { margin-top: 20px; }
  .auth-form-side { padding: 28px 20px 52px; }
}

/* ==========================================================================
   Mobil uyum: kenar menü kayan panele döner
   ========================================================================== */

@media (max-width: 900px) {
  .sidebar-toggle { display: inline-flex; }
  .admin-sidebar {
    position: fixed; left: 0; top: 0; height: 100vh;
    transform: translateX(-100%);
    box-shadow: var(--shadow-pop);
  }
  .admin-sidebar.is-open { transform: translateX(0); }
  .admin-main { padding: 20px 16px 48px; }
  .admin-topbar { padding: 0 16px; }
  .user-name { display: none; }
}

@media (max-width: 560px) {
  .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
  .admin-card { padding: 18px; }
}

/* ==========================================================================
   Sohbet baloncuğu (sağ alt köşe) — ana sitedeki aynı bileşenin bu panelin
   kendi tasarım token'larına uyarlanmış hali (birebir aynı işlevsellik).
   ========================================================================== */
/* Bu bileşenler JS tarafından [hidden] özniteliğiyle gizlenir; ama aşağıdaki
   display: kuralları eşit özgüllükte olduğu için (ve stil sayfası tarayıcının
   [hidden]{display:none} varsayılanından SONRA geldiği için) onu geçersiz
   kılardı — bu yüzden [hidden] burada açıkça yeniden belirtilir. */
.imchat-bubble-badge[hidden], .imchat-unread[hidden], .imchat-file-preview[hidden],
.imchat-panel[hidden], .imchat-panel-thread[hidden], .imchat-panel-list[hidden] { display: none; }

.imchat-widget { position: fixed; right: 20px; bottom: 20px; z-index: 200; }

.imchat-bubble {
  position: relative; width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(100deg, var(--brand-1), var(--brand-2)); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 28px -8px rgba(226,58,99,0.55), var(--shadow-pop); transition: transform .15s ease;
}
.imchat-bubble:hover { transform: translateY(-2px) scale(1.03); }
.imchat-bubble.is-active { box-shadow: 0 0 0 3px rgba(226,58,99,0.28), 0 10px 28px -8px rgba(226,58,99,0.55); }
.imchat-bubble svg { width: 24px; height: 24px; }
.imchat-bubble-badge {
  position: absolute; top: -3px; right: -3px; display: inline-flex; align-items: center; justify-content: center;
  min-width: 21px; height: 21px; padding: 0 5px; border-radius: 100px; background: var(--error); color: #fff;
  font-size: 11px; font-weight: 700; border: 2px solid var(--card-bg); line-height: 1;
}

.imchat-panel {
  position: absolute; right: 0; bottom: 72px; width: 360px; height: min(70vh, 560px); min-height: 380px;
  background: var(--card-bg); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-pop); display: flex; flex-direction: column; overflow: hidden;
}
.imchat-panel-list, .imchat-panel-thread { display: flex; flex-direction: column; height: 100%; min-height: 0; }

.imchat-panel-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.imchat-panel-head strong { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink); font-weight: 700; flex: 1; }
.imchat-panel-head strong svg { width: 17px; height: 17px; color: var(--brand-2); }
.imchat-panel-close {
  margin-left: auto; border: none; background: none; color: var(--admin-text-soft); font-size: 20px; line-height: 1;
  cursor: pointer; width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
}
.imchat-panel-close:hover { background: var(--surface); color: var(--ink); }
.imchat-panel-back { border: none; background: none; color: var(--admin-text-soft); cursor: pointer; flex-shrink: 0; display: flex; }
.imchat-panel-back svg { width: 19px; height: 19px; }
.imchat-panel-title { min-width: 0; flex: 1; }
.imchat-panel-title strong { display: block; font-size: 14px; color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imchat-panel-title span { display: block; font-size: 11.5px; color: var(--admin-text-soft); margin-top: 1px; }

.imchat-panel-conversations { flex: 1; overflow-y: auto; padding: 6px; min-height: 0; }
.imchat-panel-loading { text-align: center; color: var(--admin-text-soft); font-size: 12.5px; padding: 24px 12px; }

.imchat-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 12px; width: 100%;
  border: none; background: none; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  margin-bottom: 2px; transition: background .15s ease;
}
.imchat-item:hover { background: var(--surface); }

.imchat-item-avatar {
  position: relative; flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface); color: var(--admin-text-soft); display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 14px; overflow: hidden;
}
.imchat-item-avatar.is-group { background: linear-gradient(100deg, var(--brand-1), var(--brand-2)); color: #fff; }
.imchat-item-avatar.is-group svg { width: 17px; height: 17px; }
.imchat-dot {
  position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--admin-text-soft); border: 2px solid var(--card-bg);
}
.imchat-dot.is-online { background: var(--success); }

.imchat-item-body { flex: 1; min-width: 0; }
.imchat-item-title { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imchat-item-title em { font-style: normal; font-size: 10px; font-weight: 600; color: var(--admin-text-soft); border: 1px solid var(--line); border-radius: 100px; padding: 1px 6px; margin-left: 4px; }
.imchat-item-preview { display: block; font-size: 11.5px; color: var(--admin-text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

.imchat-unread {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px;
  padding: 0 5px; border-radius: 100px; background: var(--error); color: #fff; font-size: 10.5px; font-weight: 700;
}

.imchat-panel-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }

.imchat-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 84%; }
.imchat-msg.is-mine { align-self: flex-end; align-items: flex-end; }
.imchat-msg-sender { font-size: 11.5px; font-weight: 600; color: var(--brand-2); margin-bottom: 3px; padding: 0 4px; }
.imchat-msg-bubble {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px;
  padding: 10px 14px; color: var(--ink);
}
.imchat-msg.is-mine .imchat-msg-bubble { background: linear-gradient(100deg, var(--brand-1), var(--brand-2)); color: #fff; border-color: transparent; border-radius: 16px 16px 4px 16px; }
.imchat-msg-bubble p { margin: 0; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: break-word; }
.imchat-msg-photo { display: block; }
.imchat-msg-photo img { display: block; max-width: 240px; max-height: 240px; border-radius: 10px; object-fit: cover; }
.imchat-msg-photo + p { margin-top: 8px; }
.imchat-msg-time { font-size: 10.5px; color: var(--admin-text-soft); margin-top: 3px; padding: 0 4px; }

.imchat-file-preview {
  display: flex; align-items: center; gap: 10px; padding: 8px 18px; border-top: 1px solid var(--line);
  background: var(--surface); flex-shrink: 0;
}
.imchat-file-preview img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.imchat-file-preview span { flex: 1; font-size: 12.5px; color: var(--admin-text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imchat-file-preview button { border: none; background: none; color: var(--admin-text-soft); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }
.imchat-file-preview button:hover { color: var(--error); }

.imchat-composer-error { display: block; padding: 0 18px; color: var(--error); font-size: 12.5px; }
.imchat-composer-error:empty { display: none; }

.imchat-composer {
  display: flex; align-items: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.imchat-attach-btn {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  color: var(--admin-text-soft); border: 1.5px solid var(--line); cursor: pointer; background: var(--surface);
}
.imchat-attach-btn:hover { border-color: var(--brand-2); color: var(--brand-2); }
.imchat-attach-btn svg { width: 17px; height: 17px; }
.imchat-composer textarea {
  flex: 1; resize: none; max-height: 140px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font-family: inherit; font-size: 14px; line-height: 1.4;
}
.imchat-send-btn {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(100deg, var(--brand-1), var(--brand-2)); color: #fff; border: none; cursor: pointer;
}
.imchat-send-btn svg { width: 16px; height: 16px; }
.imchat-send-btn:disabled { opacity: 0.6; cursor: default; }

/* Küçük ekranlarda panel, köşede yüzen bir kart yerine tam ekran bir sayfa
   gibi davranır (yaygın sohbet widget deseni) — baloncuk, panel açıkken
   üstte kalabalık etmesin diye gizlenir (bkz. JS'teki .is-open sınıfı). */
@media (max-width: 480px) {
  .imchat-widget { right: 0; bottom: 0; left: 0; }
  .imchat-panel { position: fixed; inset: 0; width: auto; height: 100%; min-height: 0; border-radius: 0; }
  .imchat-bubble { position: fixed; right: 18px; bottom: 18px; }
  .imchat-widget.is-open .imchat-bubble { display: none; }
  .imchat-msg { max-width: 88%; }
}
