/* ================================================================
   Trendyol Yönetim Paneli — Ana Stylesheet
   Tema: Dark Mode + Trendyol Turuncu (#f27a1a)
   ================================================================ */

/* ── Google Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Değişkenleri ─────────────────────────────────────────── */
:root {
  --primary:       #f27a1a;
  --primary-dark:  #d4640f;
  --primary-light: #ffa04d;
  --bg-dark:       #0d0d0f;
  --bg-card:       #16161a;
  --bg-sidebar:    #111114;
  --bg-header:     #111114;
  --border:        #2a2a32;
  --text-primary:  #f0f0f4;
  --text-secondary:#9898a8;
  --text-muted:    #5a5a6e;
  --success:       #22c55e;
  --warning:       #eab308;
  --danger:        #ef4444;
  --info:          #3b82f6;
  --sidebar-width: 260px;
  --header-height: 64px;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 4px 24px rgba(0,0,0,.45);
  --shadow-card:   0 2px 16px rgba(0,0,0,.35);
  --transition:    all .2s ease;
}

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-light); }
img { max-width: 100%; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Layout ───────────────────────────────────────────────────── */
.wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 1000;
  transition: transform .3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  min-height: var(--header-height);
}
.sidebar-brand .brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(242,122,26,.4);
}
.sidebar-brand .brand-text { line-height: 1.2; }
.sidebar-brand .brand-name { font-weight: 700; font-size: 15px; color: var(--text-primary); }
.sidebar-brand .brand-sub  { font-size: 11px; color: var(--text-muted); }

.sidebar-section { padding: 12px 12px 0; }
.sidebar-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  color: var(--text-muted); text-transform: uppercase;
  padding: 10px 10px 6px;
}
.sidebar-nav { padding: 4px 0 12px; }
.sidebar-nav .nav-item { margin-bottom: 2px; }
.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500; font-size: 13.5px;
  transition: var(--transition);
  position: relative;
}
.sidebar-nav .nav-link .nav-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: transparent;
  font-size: 15px;
  transition: var(--transition);
  flex-shrink: 0;
}
.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  color: var(--text-primary);
  background: rgba(242,122,26,.08);
}
.sidebar-nav .nav-link:hover .nav-icon,
.sidebar-nav .nav-link.active .nav-icon {
  background: rgba(242,122,26,.15);
  color: var(--primary);
}
.sidebar-nav .nav-link.active { color: var(--primary); }
.sidebar-nav .nav-link.active::before {
  content: '';
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.sidebar-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 99px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.03);
}
.sidebar-user .user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), #ff6b35);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
  flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name  { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role  { font-size: 11px; color: var(--text-muted); }
.sidebar-user .user-logout { color: var(--text-muted); font-size: 15px; }
.sidebar-user .user-logout:hover { color: var(--danger); }

/* ── Top Header ───────────────────────────────────────────────── */
.main-header {
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0; z-index: 900;
}
.header-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); font-size: 18px;
  display: none;
  padding: 6px;
}
.header-title { font-weight: 600; font-size: 16px; color: var(--text-primary); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.header-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 15px; cursor: pointer;
  transition: var(--transition);
}
.header-btn:hover { background: rgba(242,122,26,.1); color: var(--primary); border-color: var(--primary); }
.header-divider { width: 1px; height: 24px; background: var(--border); }

/* ── Main Content ─────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-content { padding: 24px; flex: 1; }
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 22px; font-weight: 700; }
.page-header .text-muted { color: var(--text-muted); font-size: 13px; }
.breadcrumb { background: none; padding: 0; margin: 0; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }
.breadcrumb-item a { color: var(--text-muted); }
.breadcrumb-item.active { color: var(--primary); }

/* ── Cards ────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: transparent;
}
.card-header .card-title {
  font-weight: 600; font-size: 15px; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.card-header .card-title .icon {
  color: var(--primary); font-size: 16px;
}
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: transparent;
}

/* ── Stat Cards ───────────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), transparent);
  opacity: 0;
  transition: var(--transition);
}
.stat-card:hover { border-color: rgba(242,122,26,.3); transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card:hover::before { opacity: 1; }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-icon.orange { background: rgba(242,122,26,.12); color: var(--primary); }
.stat-icon.green  { background: rgba(34,197,94,.12);  color: var(--success); }
.stat-icon.blue   { background: rgba(59,130,246,.12); color: var(--info); }
.stat-icon.red    { background: rgba(239,68,68,.12);  color: var(--danger); }
.stat-info { flex: 1; }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1; color: var(--text-primary); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-change { font-size: 11px; margin-top: 6px; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger);  }

/* ── Tables ───────────────────────────────────────────────────── */
.table-wrapper { border-radius: var(--radius); overflow: hidden; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--text-primary); margin: 0; }
.table thead th {
  background: rgba(255,255,255,.03);
  color: var(--text-muted);
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding: 12px 16px; white-space: nowrap;
}
.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(42,42,50,.6);
  vertical-align: middle;
  color: var(--text-primary);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(242,122,26,.04); }

/* DataTables Dark */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  background: var(--bg-dark); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 12px;
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label { color: var(--text-muted); font-size: 13px; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
  background: var(--bg-card); color: var(--text-secondary) !important;
  border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important;
  margin: 0 2px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important;
}

/* ── Badges / Status ──────────────────────────────────────────── */
.badge-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600;
}
.badge-status::before { content: '●'; font-size: 8px; }
.badge-created  { background: rgba(59,130,246,.12); color: var(--info); }
.badge-picking  { background: rgba(234,179,8,.12);  color: var(--warning); }
.badge-invoiced { background: rgba(168,85,247,.12); color: #a855f7; }
.badge-shipped  { background: rgba(34,197,94,.12);  color: var(--success); }
.badge-delivered{ background: rgba(34,197,94,.2);   color: #16a34a; }
.badge-cancelled{ background: rgba(239,68,68,.12);  color: var(--danger); }
.badge-returned { background: rgba(249,115,22,.12); color: #f97316; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none; color: #fff;
  font-weight: 600; border-radius: var(--radius-sm);
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(242,122,26,.3);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-light), var(--primary)); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(242,122,26,.4); color: #fff; }
.btn-outline-primary { border-color: var(--primary); color: var(--primary); background: transparent; border-radius: var(--radius-sm); font-weight: 500; }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-sm { font-size: 12px; padding: 5px 12px !important; }
.btn-icon { width: 34px; height: 34px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm) !important; }
.btn-ghost { background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--text-secondary); border-radius: var(--radius-sm); font-weight: 500; transition: var(--transition); }
.btn-ghost:hover { background: rgba(255,255,255,.08); color: var(--text-primary); }

/* ── Forms ────────────────────────────────────────────────────── */
.form-control, .form-select {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  transition: var(--transition);
}
.form-control:focus, .form-select:focus {
  background: var(--bg-dark);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(242,122,26,.15);
  color: var(--text-primary);
}
.form-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-control::placeholder { color: var(--text-muted); }

/* ── Alert Boxes ──────────────────────────────────────────────── */
.alert { border-radius: var(--radius-sm); border: none; font-size: 13.5px; }
.alert-success { background: rgba(34,197,94,.1);  color: #86efac; }
.alert-danger   { background: rgba(239,68,68,.1);  color: #fca5a5; }
.alert-warning  { background: rgba(234,179,8,.1);  color: #fde68a; }
.alert-info     { background: rgba(59,130,246,.1); color: #93c5fd; }

/* ── Order Detail Card ────────────────────────────────────────── */
.order-product-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.order-product-item:last-child { border-bottom: none; }
.order-product-img {
  width: 48px; height: 48px;
  background: rgba(255,255,255,.05);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 20px;
  flex-shrink: 0;
}

/* ── Loading Spinner ──────────────────────────────────────────── */
.spinner-overlay {
  position: fixed; inset: 0;
  background: rgba(13,13,15,.8);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; backdrop-filter: blur(4px);
}
.spinner-border { color: var(--primary); width: 3rem; height: 3rem; }

/* ── Login Page ───────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--bg-dark);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(242,122,26,.12) 0%, transparent 70%);
  top: -200px; right: -200px;
  pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(242,122,26,.06) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  pointer-events: none;
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  position: relative; z-index: 1;
}
.login-logo {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-bottom: 32px;
}
.login-logo .logo-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff;
  box-shadow: 0 8px 24px rgba(242,122,26,.4);
}
.login-logo .logo-text h1 { font-size: 20px; font-weight: 700; }
.login-logo .logo-text span { font-size: 12px; color: var(--text-muted); }

/* ── Chart Container ──────────────────────────────────────────── */
.chart-container { position: relative; }

/* ── Progress Bars ────────────────────────────────────────────── */
.progress { background: var(--bg-dark); border-radius: 99px; height: 6px; }
.progress-bar { background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 99px; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(0,0,0,.6);
  }
  .main-content { margin-left: 0; }
  .header-toggle { display: flex; }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 999;
    backdrop-filter: blur(2px);
  }
  .sidebar-overlay.open { display: block; }
}
@media (max-width: 575.98px) {
  .page-content { padding: 16px; }
  .stat-card { flex-direction: column; text-align: center; }
  .login-card { padding: 28px 20px; }
}

/* ── Pulse Animation ──────────────────────────────────────────── */
@keyframes pulse-orange {
  0%   { box-shadow: 0 0 0 0 rgba(242,122,26,.5); }
  70%  { box-shadow: 0 0 0 10px rgba(242,122,26,0); }
  100% { box-shadow: 0 0 0 0 rgba(242,122,26,0); }
}
.pulse { animation: pulse-orange 2s infinite; }

/* ── Skeleton Loader ──────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -468px 0; }
  100% { background-position: 468px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,.04) 50%, var(--bg-card) 75%);
  background-size: 936px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}

/* ── Toastr override ──────────────────────────────────────────── */
#toast-container > div { border-radius: var(--radius-sm) !important; opacity: 1 !important; }
#toast-container > .toast-success { background-color: rgba(22,163,74,.9)  !important; }
#toast-container > .toast-error   { background-color: rgba(220,38,38,.9)  !important; }
#toast-container > .toast-warning { background-color: rgba(202,138,4,.9)  !important; }
#toast-container > .toast-info    { background-color: rgba(37,99,235,.9)  !important; }
