/* ==========================================================================
   M.Çakıroğlu Züccaciye Toptan Satış Portalı - Ortak Stil Dosyası
   ========================================================================== */

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #eef2ff;
  --accent: #f59e0b;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --info: #0284c7;
  --info-bg: #e0f2fe;
  --primary-bg: #e0e7ff;

  --bg: #f4f5fb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #1f2330;
  --text-muted: #6b7280;

  --sidebar-w: 260px;
  --topbar-h: 68px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-md: 0 8px 24px rgba(17, 24, 39, 0.08);
}

* { box-sizing: border-box; }

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

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

/* ---------------- Scrollbar ---------------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd0dc; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   Giriş (Login) Ekranı
   ========================================================================== */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 10% 10%, rgba(255,255,255,0.08), transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(255,255,255,0.06), transparent 40%),
    linear-gradient(135deg, var(--primary-dark), var(--primary) 55%, #7c3aed);
  padding: 24px;
}

.auth-wrapper {
  width: 100%;
  max-width: 960px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(20, 20, 60, 0.35);
}

.auth-side {
  background: linear-gradient(160deg, var(--primary-dark), var(--primary) 65%, #6d28d9);
  color: #fff;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.auth-side::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  bottom: -120px;
  right: -80px;
}

.auth-side .logo-mark {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 28px;
  backdrop-filter: blur(4px);
}

.auth-side h2 {
  font-size: 26px;
  margin: 0 0 12px;
  line-height: 1.3;
}

.auth-side p {
  color: rgba(255,255,255,0.85);
  font-size: 14.5px;
  max-width: 320px;
}

.auth-side .side-features { margin-top: 32px; }
.auth-side .side-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 13.5px;
  color: rgba(255,255,255,0.92);
}
.auth-side .side-features li .dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}

.auth-side .side-footer {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  position: relative;
  z-index: 1;
}

.auth-form-area {
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-form-area h1 {
  font-size: 22px;
  margin: 0 0 4px;
}
.auth-form-area .sub {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 24px;
}

.tab-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f1f2f8;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 26px;
}
.tab-switch button {
  border: none;
  background: transparent;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab-switch button.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.2s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Standalone simple card (used by setup.php) */
.auth-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 40px;
  box-shadow: 0 30px 60px rgba(20, 20, 60, 0.35);
  width: 100%;
}
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-logo {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; margin: 0 auto 12px;
}
.setup-creds {
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 13px;
}
.setup-creds code { background: #fff; padding: 2px 6px; border-radius: 4px; }

/* ==========================================================================
   Form Elemanları
   ========================================================================== */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.form-group .hint { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

.form-control,
input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="tel"], select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: #fbfbfe;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
  background: #fff;
}
textarea { resize: vertical; min-height: 90px; }

.input-icon-wrap { position: relative; }
.input-icon-wrap input { padding-left: 40px; }
.input-icon-wrap .icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 15px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.checkbox-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fbfbfe;
  margin-bottom: 10px;
  cursor: pointer;
}
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.checkbox-row .cb-text strong { display: block; font-size: 13.5px; }
.checkbox-row .cb-text span { font-size: 12px; color: var(--text-muted); }

.file-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 22px;
  text-align: center;
  background: #fbfbfe;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.file-drop:hover { border-color: var(--primary); background: var(--primary-light); }
.file-drop .icon { font-size: 26px; margin-bottom: 6px; }
.file-drop span { font-size: 12.5px; color: var(--text-muted); display: block; }

#gorsel_onizleme {
  margin-top: 12px; max-width: 160px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); display: none;
}

/* ==========================================================================
   Butonlar
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }

/* ==========================================================================
   Admin Panel Layout
   ========================================================================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--primary-dark), #2a2472);
  color: #fff;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-brand .mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.sidebar-brand .name { font-size: 13.5px; font-weight: 700; line-height: 1.25; }
.sidebar-brand .name small { display: block; font-weight: 400; font-size: 10.5px; color: rgba(255,255,255,0.6); }

.sidebar-nav { padding: 14px 12px; overflow-y: auto; flex: 1; }
.sidebar-section-title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.4);
  padding: 14px 12px 6px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  color: rgba(255,255,255,0.82);
  margin-bottom: 3px;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-nav a .ic { font-size: 16px; width: 20px; text-align: center; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-nav a.active { background: rgba(255,255,255,0.16); color: #fff; }
.sidebar-nav a .badge-count {
  margin-left: auto; background: var(--accent); color: #1f2330;
  font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 20px;
}
.sidebar-nav a.nav-disabled {
  color: rgba(255,255,255,0.32);
  cursor: not-allowed;
  pointer-events: none;
}
.sidebar-nav a.nav-disabled .ic:last-child {
  margin-left: auto;
  font-size: 12px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}

.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar .page-title { font-size: 17px; font-weight: 700; }
.topbar .page-title span { display:block; font-size: 12px; font-weight: 400; color: var(--text-muted); }

.menu-toggle {
  display: none;
  background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text);
  margin-right: 12px;
}

.topbar-right { display: flex; align-items: center; gap: 16px; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: 30px;
  background: var(--bg);
}
.user-chip .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700;
}
.user-chip .info { line-height: 1.2; }
.user-chip .info strong { font-size: 12.5px; display: block; }
.user-chip .info span { font-size: 10.5px; color: var(--text-muted); }

.content { padding: 26px; flex: 1; }

/* ==========================================================================
   Kartlar / İstatistikler
   ========================================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.stat-card .icon-badge {
  width: 42px; height: 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
}
.stat-card .value { font-size: 26px; font-weight: 800; }
.stat-card .label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.stat-card .trend { font-size: 11.5px; font-weight: 600; }
.stat-card .trend.up { color: var(--success); }
.stat-card .trend.down { color: var(--danger); }

.icon-badge.i-indigo { background: var(--primary-bg); color: var(--primary); }
.icon-badge.i-green { background: var(--success-bg); color: var(--success); }
.icon-badge.i-amber { background: var(--warning-bg); color: var(--warning); }
.icon-badge.i-red { background: var(--danger-bg); color: var(--danger); }
.icon-badge.i-blue { background: var(--info-bg); color: var(--info); }
.icon-badge.i-purple { background: #f3e8ff; color: #7c3aed; }

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.panel-header h3 { font-size: 15.5px; margin: 0; }
.panel-header .sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.panel-body { padding: 20px 22px; }
.panel-body.no-pad { padding: 0; }

.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }

/* ==========================================================================
   Tablolar
   ========================================================================== */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.search-box {
  position: relative;
  min-width: 240px;
  flex: 1;
  max-width: 320px;
}
.search-box input {
  padding-left: 36px;
  padding-top: 9px;
  padding-bottom: 9px;
}
.search-box .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.table-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.table-filters select { padding: 9px 12px; width: auto; min-width: 150px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
thead th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 12px 22px;
  background: #fafafe;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbff; }

.cell-product { display: flex; align-items: center; gap: 12px; }
.cell-product .thumb {
  width: 42px; height: 42px; border-radius: 9px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--primary);
  overflow: hidden; flex-shrink: 0;
}
.cell-product .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cell-product strong { display: block; font-size: 13.5px; }
.cell-product span { font-size: 11.5px; color: var(--text-muted); }

.row-actions { display: flex; gap: 8px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-neutral { background: #f1f2f8; color: var(--text-muted); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 40px; margin-bottom: 10px; }

/* ==========================================================================
   Uyarılar / Flash Mesajlar
   ========================================================================== */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: var(--success-bg); color: #15803d; }
.alert-error { background: var(--danger-bg); color: #b91c1c; }
.alert-info { background: var(--info-bg); color: #0369a1; }

/* ==========================================================================
   Modal
   ========================================================================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 15, 35, 0.5);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff; border-radius: var(--radius); max-width: 480px; width: 100%;
  padding: 26px; box-shadow: var(--shadow-md);
}
.modal-box h3 { margin: 0 0 8px; font-size: 16px; }
.modal-box p { color: var(--text-muted); font-size: 13.5px; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ==========================================================================
   Diğer
   ========================================================================== */
.muted { color: var(--text-muted); }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0 !important; }
.chip-list { display: flex; gap: 8px; flex-wrap: wrap; }

.progress-track {
  background: #eef0f7; border-radius: 20px; height: 8px; overflow: hidden;
}
.progress-fill { height: 100%; border-radius: 20px; background: var(--primary); }

.mini-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.mini-list li:last-child { border-bottom: none; }

.pagination { display: flex; justify-content: flex-end; gap: 6px; padding: 16px 22px; }
.pagination a, .pagination span {
  min-width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; border: 1px solid var(--border); color: var(--text);
}
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .auth-wrapper { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}

@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .topbar { padding: 0 14px; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: none; }
  .panel-header { flex-direction: column; align-items: flex-start; }
}

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 35;
}
.sidebar-backdrop.open { display: block; }

.is-hidden { display: none !important; }

/* ==========================================================================
   Ürün Kartı / Grid (Bayi Kataloğu & Kampanyalar)
   ========================================================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.product-card .img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(150deg, var(--primary-light), #f5f3ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--primary);
}
.product-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; }

.product-card .card-badges {
  position: absolute;
  top: 10px; left: 10px;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.product-card .stock-badge {
  position: absolute; top: 10px; right: 10px;
}

.product-card .body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
.product-card .cat-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
}
.product-card .title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  min-height: 38px;
}
.product-card .sku {
  font-size: 11px;
  color: var(--text-muted);
}
.product-card .price-row {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.product-card .price { font-size: 16.5px; font-weight: 800; color: var(--primary-dark); }

.product-card .cart-form {
  display: flex;
  gap: 6px;
  padding: 0 16px 16px;
}
.product-card .cart-form input[type="number"] {
  width: 56px;
  padding: 8px 6px;
  text-align: center;
}
.product-card .cart-form .btn { flex: 1; }

.product-card .admin-action { padding: 0 16px 16px; }

/* ==========================================================================
   Destek Talebi Mesaj Akışı
   ========================================================================== */
.ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 520px;
  overflow-y: auto;
  padding: 4px 4px 4px 0;
  margin-bottom: 18px;
}
.msg-row { display: flex; flex-direction: column; max-width: 78%; }
.msg-row.yeni-grup { margin-top: 14px; }
.msg-row:first-child { margin-top: 0; }
.msg-row.mine { align-self: flex-end; align-items: flex-end; }
.msg-row.other { align-self: flex-start; align-items: flex-start; }
.msg-row.system { align-self: center; align-items: center; max-width: 90%; }

.msg-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 3px;
  padding: 0 4px;
  line-height: 1.3;
}
.msg-bubble {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  text-align: left;
}
.msg-row.mine .msg-bubble { background: #f1f2f8; color: var(--text); border-bottom-right-radius: 4px; }
.msg-row.other .msg-bubble { background: #f1f2f8; color: var(--text); border-bottom-left-radius: 4px; }
.msg-row.system .msg-bubble {
  background: var(--bg);
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  border-radius: 20px;
  padding: 9px 18px;
}
.msg-bubble img {
  margin-top: 8px;
  border-radius: 10px;
  width: auto;
  height: auto;
  max-width: 200px;
  max-height: 200px;
  display: block;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.08);
}

.msg-form { border-top: 1px solid var(--border); padding-top: 16px; }
.msg-form .msg-form-row { display: flex; gap: 10px; align-items: flex-end; }
.msg-form textarea { min-height: 70px; }
.msg-image-picker {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted); margin-top: 8px; cursor: pointer;
}
.msg-image-picker input { display: none; }
.msg-image-preview-name { font-size: 12px; color: var(--primary); font-weight: 600; }

/* ==========================================================================
   Sidebar - Bayi Bilgi Kartı
   ========================================================================== */
.sidebar-bayi-info {
  margin: 10px 12px 0;
  padding: 14px;
  background: rgba(255,255,255,0.07);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
}
.sidebar-bayi-info .baslik {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.45);
  margin-bottom: 8px;
}
.sidebar-bayi-info .firma {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.3;
}
.sidebar-bayi-info .satir {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 4px;
  word-break: break-word;
}
.sidebar-bayi-info .satir .ic { font-size: 12px; flex-shrink: 0; }

/* ==========================================================================
   Sipariş Durum Hareketleri (Zaman Çizelgesi)
   ========================================================================== */
.timeline { position: relative; padding-left: 6px; }
.timeline-item {
  display: flex;
  gap: 12px;
  position: relative;
  padding-bottom: 22px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 16px;
  bottom: -6px;
  width: 2px;
  background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  background: var(--text-muted);
}
.timeline-dot.badge-success { background: var(--success); }
.timeline-dot.badge-warning { background: var(--warning); }
.timeline-dot.badge-info { background: var(--info); }
.timeline-dot.badge-primary { background: var(--primary); }
.timeline-dot.badge-danger { background: var(--danger); }
.timeline-baslik { font-size: 13px; font-weight: 700; }
.timeline-aciklama { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }
.timeline-tarih { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
