/* ═══════════════════════════════════════════════════════════
   İKİZLERSÜT ERP — Ana Stil Dosyası
   Renk Paleti: Mavi/Lacivert (süt & güven teması)
   ═══════════════════════════════════════════════════════════ */

:root {
  --primary:    #1e3a8a;
  --primary-md: #2563eb;
  --primary-lt: #3b82f6;
  --sidebar-w:  260px;
  --sidebar-bg: #0f172a;
  --sidebar-txt:#94a3b8;
  --sidebar-act:#3b82f6;
  --topbar-h:   60px;
  --bg:         #f1f5f9;
  --surface:    #ffffff;
  --border:     #e2e8f0;
  --text:       #1e293b;
  --text-muted: #64748b;
  --radius:     10px;
  --shadow:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  font-size: 14px;
  overflow-x: hidden;
}

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ════════════════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════════════════ */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .3s ease;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.logo-mark  { font-size: 32px; }
.brand-name { font-size: 16px; font-weight: 700; color: #f1f5f9; letter-spacing: .3px; }
.brand-sub  { font-size: 11px; color: var(--sidebar-txt); }

.nav-menu { list-style: none; margin: 8px 0; padding: 0; flex: 1; }

.nav-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: rgba(148,163,184,.5);
  padding: 12px 16px 4px;
}

.nav-item { margin: 2px 8px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--sidebar-txt);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s, color .15s;
  position: relative;
}
.nav-link:hover {
  background: rgba(255,255,255,.06);
  color: #e2e8f0;
}
.nav-link.active {
  background: rgba(59,130,246,.15);
  color: var(--sidebar-act);
}
.nav-link.active .nav-icon { color: var(--sidebar-act); }

.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  color: #64748b;
  flex-shrink: 0;
}

.badge-count {
  margin-left: auto;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: auto;
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary-md);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.user-name  { font-size: 13px; font-weight: 600; color: #e2e8f0; }
.user-role  { font-size: 11px; color: var(--sidebar-txt); }
.logout-btn {
  margin-left: auto;
  color: var(--sidebar-txt);
  font-size: 16px;
  text-decoration: none;
  transition: color .15s;
}
.logout-btn:hover { color: #ef4444; }

/* Mobil overlay */
#sidebarOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 999;
}

/* ════════════════════════════════════════════════════════════
   ANA İÇERİK
   ════════════════════════════════════════════════════════════ */
#mainContent {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .3s;
}

/* Üst Bar */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.sidebar-toggle {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  padding: 4px 8px;
  border-radius: 6px;
}
.sidebar-toggle:hover { background: var(--bg); }
.topbar-actions { display: flex; gap: 8px; }

/* Sayfa İçeriği */
.page-content {
  flex: 1;
  padding: 24px;
}

/* Flash */
.flash-container { padding: 16px 24px 0; }

/* ════════════════════════════════════════════════════════════
   KART BİLEŞENLERİ
   ════════════════════════════════════════════════════════════ */
.card-panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel-header { margin-bottom: 16px; }
.panel-title  { font-size: 14px; font-weight: 700; color: var(--text); margin: 0; }

/* ── Stat Kartlar ── */
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left-width: 4px;
  padding: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: white;
  margin-bottom: 12px;
}
.stat-val   { font-size: 26px; font-weight: 800; line-height: 1; color: var(--text); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Renk varyantları */
.border-blue   { border-left-color: #3b82f6; }
.border-green  { border-left-color: #10b981; }
.border-orange { border-left-color: #f59e0b; }
.border-purple { border-left-color: #8b5cf6; }
.border-teal   { border-left-color: #14b8a6; }
.border-red    { border-left-color: #ef4444; }

.bg-blue   { background: #3b82f6; }
.bg-green  { background: #10b981; }
.bg-orange { background: #f59e0b; }
.bg-purple { background: #8b5cf6; }
.bg-teal   { background: #14b8a6; }
.bg-red    { background: #ef4444; }

/* ─── Tablo ─────────────────────────────────────────────────── */
.table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  padding: 10px 12px;
}
.table td { padding: 10px 12px; vertical-align: middle; }

/* ─── Kanal Rozet ───────────────────────────────────────────── */
.channel-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.channel-whatsapp  { background: rgba(37,211,102,.15);  color: #15803d; }
.channel-sms       { background: rgba(59,130,246,.15);  color: #1d4ed8; }
.channel-email     { background: rgba(234,67,53,.12);   color: #b91c1c; }
.channel-instagram { background: rgba(225,48,108,.12);  color: #9d174d; }
.channel-telefon   { background: rgba(245,158,11,.15);  color: #92400e; }
.channel-manuel    { background: rgba(100,116,139,.15); color: #475569; }

/* ─── Mesaj Baloncukları ───────────────────────────────────── */
.msg-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 10px;
  font-size: 13px;
}
.msg-in  { background: #f1f5f9; align-self: flex-start; border-radius: 0 12px 12px 12px; }
.msg-out { background: rgba(59,130,246,.12); margin-left: auto; border-radius: 12px 0 12px 12px; }
.msg-meta { font-size: 10px; color: var(--text-muted); margin-bottom: 4px; }

/* ─── Rota Öğesi ─────────────────────────────────────────── */
.route-item {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.route-item:hover { border-color: var(--primary-lt); background: rgba(59,130,246,.04); }

/* ─── Kullanıcı Avatar (küçük) ───────────────────────────── */
.user-avatar-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary-md);
  color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   GİRİŞ SAYFASI
   ════════════════════════════════════════════════════════════ */
.login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1d4ed8 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-wrapper { width: 100%; max-width: 420px; padding: 24px; }
.login-card {
  background: white;
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 25px 50px rgba(0,0,0,.25);
}
.login-logo  { text-align: center; margin-bottom: 28px; }
.login-icon  { font-size: 56px; }
.login-brand {
  font-size: 26px; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-lt));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 8px 0 4px;
}
.login-subtitle { color: var(--text-muted); font-size: 13px; }

/* ════════════════════════════════════════════════════════════
   TOAST BİLDİRİM
   ════════════════════════════════════════════════════════════ */
#toastContainer {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast-item {
  padding: 12px 18px;
  border-radius: 8px;
  color: white;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: slideIn .25s ease;
  min-width: 240px;
}
@keyframes slideIn { from { opacity:0; transform:translateX(40px); } to { opacity:1; transform:translateX(0); } }
.toast-success { background: #10b981; }
.toast-danger  { background: #ef4444; }
.toast-info    { background: #3b82f6; }
.toast-warning { background: #f59e0b; color: #1e293b; }

/* ════════════════════════════════════════════════════════════
   BOOTSTRAP OVERRIDE
   ════════════════════════════════════════════════════════════ */
.btn-primary    { background: var(--primary-md); border-color: var(--primary-md); }
.btn-primary:hover { background: var(--primary); border-color: var(--primary); }
.form-control:focus, .form-select:focus {
  border-color: var(--primary-lt);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

/* ════════════════════════════════════════════════════════════
   MOBİL UYUMLULUK
   ════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
  }
  #sidebar.open {
    transform: translateX(0);
  }
  #sidebarOverlay.open {
    display: block;
  }
  #mainContent {
    margin-left: 0;
  }
  .sidebar-toggle {
    display: block;
  }
  .page-content { padding: 16px; }
  .stat-val     { font-size: 20px; }
  .login-card   { padding: 28px 20px; }
}
