/* ================================================================
   ARADEPO — Kurumsal Tema
   Modern SaaS Dashboard · Bootstrap 5 · Responsive
   ================================================================ */

/* ── Google Font ───────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Değişkenleri ──────────────────────────────────────── */
:root {
  --sidebar-w:        260px;
  --sidebar-w-col:     68px;
  --topbar-h:          62px;
  --footer-h:          44px;

  /* Marka renkleri */
  --brand-1:          #1a237e;   /* koyu lacivert */
  --brand-2:          #283593;
  --brand-3:          #3949ab;
  --accent:           #5c6bc0;
  --accent-light:     #e8eaf6;

  /* Sidebar */
  --sb-bg:            #0f1535;
  --sb-bg2:           #141c40;
  --sb-link:          #a0aec0;
  --sb-link-hover:    #ffffff;
  --sb-active-bg:     rgba(99,102,241,.18);
  --sb-active-txt:    #818cf8;
  --sb-section:       #4a5568;
  --sb-border:        rgba(255,255,255,.06);

  /* Genel */
  --bg-page:          #f0f2f8;
  --bg-card:          #ffffff;
  --text-main:        #1a202c;
  --text-muted:       #718096;
  --border:           #e2e8f0;
  --radius:           12px;
  --radius-sm:         8px;
  --shadow-sm:        0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:           0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:        0 10px 40px rgba(0,0,0,.12);

  /* Durum renkleri */
  --c-success:        #10b981;
  --c-danger:         #ef4444;
  --c-warning:        #f59e0b;
  --c-info:           #3b82f6;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  font-size: .9rem;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { text-decoration: none; }
img { max-width: 100%; }

/* ── Layout Wrapper ────────────────────────────────────────── */
#layout {
  display: flex;
  min-height: 100vh;
}

/* ════════════════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════════════════ */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0;
  z-index: 1040;
  transition: width .28s cubic-bezier(.4,0,.2,1),
              transform .28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  border-right: 1px solid var(--sb-border);
}

#sidebar.collapsed { width: var(--sidebar-w-col); }

/* Logo alanı */
.sb-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
}

.sb-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--brand-3), #7c3aed);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99,102,241,.4);
}

.sb-logo-text { line-height: 1.2; }
.sb-logo-text strong {
  display: block;
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.02em;
}
.sb-logo-text span {
  font-size: .68rem;
  color: var(--sb-link);
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Scroll alanı */
.sb-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sb-scroll::-webkit-scrollbar { width: 4px; }
.sb-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

/* Bölüm başlığı */
.sb-label {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--sb-section);
  text-transform: uppercase;
  padding: 14px 22px 5px;
  white-space: nowrap;
  overflow: hidden;
}

#sidebar.collapsed .sb-label { opacity: 0; height: 0; padding: 0; overflow: hidden; }

/* Menü öğesi */
.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sb-link);
  font-size: .865rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s;
  cursor: pointer;
  border: none;
  background: transparent;
  width: calc(100% - 20px);
  text-align: left;
}

.sb-item i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  transition: color .15s;
}

.sb-item:hover {
  background: rgba(255,255,255,.07);
  color: var(--sb-link-hover);
}

.sb-item.active {
  background: var(--sb-active-bg);
  color: var(--sb-active-txt);
  font-weight: 600;
}

.sb-item.active i { color: var(--sb-active-txt); }

#sidebar.collapsed .sb-item {
  justify-content: center;
  padding: 9px;
  margin: 1px auto;
  width: 44px;
}

#sidebar.collapsed .sb-item span,
#sidebar.collapsed .sb-item .sb-badge { display: none; }

/* Badge */
.sb-badge {
  margin-left: auto;
  background: rgba(99,102,241,.3);
  color: #818cf8;
  font-size: .62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

/* Kullanıcı alt alanı */
.sb-user {
  border-top: 1px solid var(--sb-border);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
}

.sb-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-3), #7c3aed);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sb-user-info { flex: 1; min-width: 0; }
.sb-user-info strong {
  display: block;
  font-size: .82rem;
  color: #fff;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-user-info small {
  font-size: .7rem;
  color: var(--sb-link);
  text-transform: capitalize;
}

.sb-user-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--sb-border);
  background: transparent;
  color: var(--sb-link);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
  flex-shrink: 0;
  font-size: .9rem;
}
.sb-user-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

#sidebar.collapsed .sb-user { justify-content: center; padding: 12px 0; }
#sidebar.collapsed .sb-user-info,
#sidebar.collapsed .sb-user-btn { display: none; }

/* Mobil overlay */
.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
  z-index: 1039;
}
.sb-overlay.show { display: block; }

/* ════════════════════════════════════════════════════════════
   MAIN AREA
   ════════════════════════════════════════════════════════════ */
#main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .28s cubic-bezier(.4,0,.2,1);
}

#main.expanded { margin-left: var(--sidebar-w-col); }

/* ════════════════════════════════════════════════════════════
   TOPBAR
   ════════════════════════════════════════════════════════════ */
#topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: var(--shadow-sm);
}

/* Toggle butonu */
.topbar-toggle {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background .15s, color .15s, border-color .15s;
  flex-shrink: 0;
}
.topbar-toggle:hover {
  background: var(--accent-light);
  color: var(--brand-1);
  border-color: transparent;
}

/* Breadcrumb */
.topbar-bread {
  flex: 1;
  min-width: 0;
}
.topbar-bread h6 {
  margin: 0;
  font-size: .92rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-bread small {
  font-size: .72rem;
  color: var(--text-muted);
}

/* Topbar sağ aksiyon grubu */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Barkod butonu */
.btn-barcode {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: linear-gradient(135deg, var(--brand-3), #7c3aed);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s, transform .1s;
  box-shadow: 0 3px 10px rgba(99,102,241,.35);
}
.btn-barcode:hover { opacity: .9; transform: translateY(-1px); color: #fff; }
.btn-barcode:active { transform: translateY(0); }

/* Icon butonlar (bildirim, profil) */
.topbar-icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  position: relative;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.topbar-icon-btn:hover { background: var(--accent-light); color: var(--brand-1); }

.topbar-badge {
  position: absolute;
  top: 5px; right: 5px;
  width: 8px; height: 8px;
  background: var(--c-danger);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

/* Profil butonu */
.topbar-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}
.topbar-profile:hover { background: var(--accent-light); }

.tp-avatar {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-3), #7c3aed);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem;
  font-weight: 700;
}

.tp-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-main);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tp-role {
  font-size: .68rem;
  color: var(--text-muted);
  text-transform: capitalize;
  line-height: 1;
}

/* ════════════════════════════════════════════════════════════
   SAYFA İÇERİĞİ
   ════════════════════════════════════════════════════════════ */
#page {
  flex: 1;
  padding: 24px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-header h4 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -.03em;
}

.page-header .ph-sub {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── FOOTER ──────────────────────────────────────────────── */
#footer {
  height: var(--footer-h);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-size: .75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   KARTLAR
   ════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  font-weight: 700;
  font-size: .88rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-body { padding: 18px; }
.card-body.p-0 { padding: 0; }
.card-footer {
  background: transparent;
  border-top: 1px solid var(--border);
  padding: 12px 18px;
}

/* ── Stat Kartları ───────────────────────────────────────── */
.stat-card {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
  overflow: hidden;
  position: relative;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--stat-color, var(--brand-3));
  border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-val {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  color: var(--text-main);
}

.stat-label {
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 3px;
}

.stat-trend {
  font-size: .72rem;
  font-weight: 600;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.stat-trend.up   { color: var(--c-success); }
.stat-trend.down { color: var(--c-danger); }
.stat-trend.neutral { color: var(--text-muted); }

/* ── Tablo ───────────────────────────────────────────────── */
.table { margin: 0; }

.table thead th {
  background: #f8fafc;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  padding: 10px 16px;
  white-space: nowrap;
}

.table tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: var(--text-main);
}

.table tbody tr:last-child td { border-bottom: 0; }

.table tbody tr:hover td { background: #f8fafc; }

/* ── Badge / Etiketler ───────────────────────────────────── */
.badge {
  font-size: .68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: .02em;
}

/* ── Butonlar ────────────────────────────────────────────── */
.btn {
  font-size: .84rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  transition: all .15s;
}
.btn-sm { padding: 5px 10px; font-size: .78rem; }
.btn-lg { padding: 11px 22px; font-size: .95rem; }

.btn-primary {
  background: var(--brand-3);
  border-color: var(--brand-3);
  color: #fff;
  box-shadow: 0 2px 8px rgba(57,73,171,.3);
}
.btn-primary:hover {
  background: var(--brand-2);
  border-color: var(--brand-2);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(57,73,171,.4);
}

/* ── Form kontrolleri ────────────────────────────────────── */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border);
  font-size: .875rem;
  color: var(--text-main);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-3);
  box-shadow: 0 0 0 3px rgba(57,73,171,.12);
}
.form-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 5px;
}

/* ── Filtre barı ─────────────────────────────────────────── */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

/* ── Stok renkleri ───────────────────────────────────────── */
.stock-critical { color: var(--c-danger);  font-weight: 700; }
.stock-low      { color: var(--c-warning); font-weight: 600; }
.stock-ok       { color: var(--c-success); }

/* ── Ürün thumbnail ──────────────────────────────────────── */
.product-thumb {
  width: 40px; height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f8fafc;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: .95rem;
  overflow: hidden;
  flex-shrink: 0;
}

.product-thumb-lg {
  width: 110px; height: 110px;
  border-radius: 12px;
}

/* ── Toast ───────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-msg {
  background: var(--text-main);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: .84rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s ease;
  min-width: 240px;
  max-width: 360px;
}

.toast-msg.success { background: var(--c-success); }
.toast-msg.danger  { background: var(--c-danger);  }
.toast-msg.warning { background: var(--c-warning); color: #1a202c; }
.toast-msg.info    { background: var(--c-info);    }

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

/* ── Login ───────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f1535 0%, #1a237e 50%, #0f1535 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0,0,0,.4);
}

.login-header {
  padding: 36px 32px 28px;
  text-align: center;
  background: linear-gradient(135deg, #0f1535, var(--brand-1));
}

.login-logo-wrap {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand-3), #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(99,102,241,.4);
}

.login-header h4 {
  color: #fff;
  font-weight: 800;
  font-size: 1.4rem;
  margin: 0 0 4px;
  letter-spacing: -.03em;
}

.login-header p {
  color: rgba(255,255,255,.55);
  font-size: .8rem;
  margin: 0;
}

.login-body { padding: 32px; }

/* ── Sayfalama ───────────────────────────────────────────── */
.pagination .page-link {
  border-radius: var(--radius-sm) !important;
  margin: 0 2px;
  border-color: var(--border);
  color: var(--text-main);
  font-size: .82rem;
  font-weight: 500;
  padding: 5px 10px;
}
.pagination .page-item.active .page-link {
  background: var(--brand-3);
  border-color: var(--brand-3);
}

/* ── Barcode sayfası ─────────────────────────────────────── */
#barcode-video {
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius);
  border: 3px solid var(--brand-3);
  display: block;
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-content {
  border-radius: var(--radius);
  border: none;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
}
.modal-footer {
  border-top: 1px solid var(--border);
  padding: 12px 20px;
}
.modal-title { font-weight: 700; font-size: .95rem; }

/* ── Dashboard - Aktivite feed ───────────────────────────── */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid #f1f5f9;
  transition: background .1s;
}
.activity-item:last-child { border-bottom: 0; }
.activity-item:hover { background: #f8fafc; }

.activity-dot {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Low-stock listesi ───────────────────────────────────── */
.low-stock-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid #f1f5f9;
  gap: 10px;
}
.low-stock-item:last-child { border-bottom: 0; }
.low-stock-item:hover { background: #f8fafc; }

.low-stock-num {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
  #sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
  }

  #sidebar.mobile-open { transform: translateX(0); }

  #main { margin-left: 0 !important; }

  #page { padding: 16px; }

  .btn-barcode span { display: none; }
  .tp-info { display: none; }
}

@media (max-width: 575.98px) {
  #page { padding: 12px; }
  .page-header h4 { font-size: 1.1rem; }
  .stat-val { font-size: 1.5rem; }
}

/* Dropdown menü */
.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  font-size: .86rem;
}

.dropdown-item {
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  color: var(--text-main);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .12s;
}

.dropdown-item:hover { background: var(--accent-light); color: var(--brand-1); }
.dropdown-item.text-danger:hover { background: #fef2f2; color: var(--c-danger); }
.dropdown-divider { border-color: var(--border); margin: 4px 0; }

/* Alert */
.alert {
  border-radius: var(--radius-sm);
  border: none;
  font-size: .85rem;
  font-weight: 500;
}

/* List group */
.list-group-item {
  border-color: var(--border);
  font-size: .875rem;
}
