/* ===== LOTEN Admin Panel - Premium Tasarım ===== */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --border: #e4e7ec;
  --primary: #101828;
  --primary-2: #1d2939;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: rgba(79, 70, 229, 0.08);
  --success: #067647;
  --success-bg: #ecfdf3;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --warning: #b54708;
  --warning-bg: #fffaeb;
  --info: #175cd3;
  --info-bg: #eff8ff;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 4px 16px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --display: 'Space Grotesk', sans-serif;
  --sidebar-w: 252px;
  --topbar-h: 64px;
}

body.dark-mode {
  --bg: #0c111d;
  --surface: #141b2b;
  --surface-2: #1c2436;
  --ink: #f2f4f7;
  --ink-2: #d0d5dd;
  --muted: #98a2b3;
  --border: #263043;
  --primary: #ffffff;
  --primary-2: #e4e8f1;
  --accent: #6366f1;
  --accent-soft: rgba(99, 102, 241, 0.16);
  --success: #32d583;
  --success-bg: rgba(50, 213, 131, 0.12);
  --danger: #f97066;
  --danger-bg: rgba(249, 112, 102, 0.12);
  --warning: #fdb022;
  --warning-bg: rgba(253, 176, 34, 0.12);
  --info: #53b1fd;
  --info-bg: rgba(83, 177, 253, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.35), 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  transition: background 0.2s, color 0.2s;
}
img { max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: var(--ink); }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== Login ===== */
.login-screen {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(79, 70, 229, 0.28), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, rgba(79, 70, 229, 0.18), transparent 55%),
    #0a0c12;
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 44px 40px 36px;
  width: 400px;
  max-width: 100%;
  box-shadow: var(--shadow-lg);
}
.login-mark {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff; font: 700 24px var(--display);
  display: grid; place-items: center; margin: 0 auto 20px;
}
.login-card h1 { font: 700 24px var(--display); letter-spacing: -0.5px; text-align: center; }
.login-sub { color: var(--muted); font-size: 13px; text-align: center; margin: 6px 0 28px; }
.login-field { text-align: left; margin-bottom: 18px; }
.login-field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 7px; color: var(--ink-2); }
.login-field input {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 14px; font-size: 14px; background: var(--bg); transition: 0.15s;
}
.login-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.login-error { min-height: 20px; font-size: 12px; color: var(--danger); margin-bottom: 10px; }
.btn-login {
  width: 100%; background: var(--accent); color: #fff;
  border-radius: 10px; padding: 13px; font-size: 14px; font-weight: 600;
  transition: 0.15s;
}
.btn-login:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-login:active { transform: scale(0.99); }
.login-demo { font-size: 11px; color: var(--muted); margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); text-align: center; }

/* ===== Topbar ===== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.sidebar-toggle {
  width: 38px; height: 38px; border-radius: 9px;
  display: none; place-items: center; font-size: 18px; color: var(--muted);
}
.sidebar-toggle:hover { background: var(--surface-2); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff; font: 700 17px var(--display); display: grid; place-items: center;
}
.brand-name { font: 700 18px var(--display); letter-spacing: 1px; }
.badge {
  background: var(--accent-soft); color: var(--accent);
  font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 6px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 12px; width: 260px; color: var(--muted);
}
.topbar-search input { border: none; background: transparent; width: 100%; font-size: 13px; color: var(--ink); }
.topbar-search input:focus { outline: none; }

.notif-wrap { position: relative; }
.notif-btn {
  width: 38px; height: 38px; border-radius: 9px;
  display: grid; place-items: center; color: var(--muted); position: relative; transition: 0.15s;
}
.notif-btn:hover { background: var(--surface-2); color: var(--ink); }
.notif-dot {
  position: absolute; top: 9px; right: 10px; width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%; display: none;
  border: 2px solid var(--surface);
}
.notif-dot.show { display: block; }
.notif-dropdown {
  position: absolute; top: 48px; right: 0; width: 340px; max-height: 440px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); display: none; z-index: 400;
}
.notif-wrap.open .notif-dropdown { display: block; }
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.notif-header strong { font-size: 14px; }
.notif-header button { font-size: 12px; color: var(--accent); font-weight: 600; }
.notif-item {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: 0.1s; display: flex; gap: 10px;
}
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--accent-soft); }
.notif-item.unread:hover { background: var(--accent-soft); }
.notif-item .n-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.notif-item .n-body strong { font-size: 13px; display: block; }
.notif-item .n-body p { font-size: 12px; color: var(--muted); }
.notif-item .n-body small { font-size: 10px; color: var(--muted); display: block; margin-top: 2px; }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 9px; }
.user-chip:hover { background: var(--surface-2); }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff; font-weight: 600; display: grid; place-items: center; font-size: 14px;
}
.user-meta span { font-size: 13px; font-weight: 500; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 9px;
  display: grid; place-items: center; transition: 0.15s; font-size: 15px;
}
.theme-toggle:hover { background: var(--surface-2); }
.btn-logout {
  width: 38px; height: 38px; border-radius: 9px;
  display: grid; place-items: center; color: var(--muted); transition: 0.15s;
}
.btn-logout:hover { background: var(--danger-bg); color: var(--danger); }

/* ===== Layout ===== */
.layout { padding-top: var(--topbar-h); min-height: 100vh; }
.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0;
  width: var(--sidebar-w); background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 12px 24px; overflow-y: auto; z-index: 90;
  transition: transform 0.2s;
}
.sidebar-group { margin-bottom: 8px; }
.sidebar-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--muted); padding: 10px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 500;
  color: var(--ink-2); transition: 0.12s; margin-bottom: 2px; text-align: left;
  cursor: pointer;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
body.dark-mode .nav-item.active { background: var(--accent); }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }

.content { margin-left: var(--sidebar-w); padding: 28px 32px 48px; max-width: 1440px; }
.page-head { margin-bottom: 24px; }
.page-title { font: 700 24px var(--display); letter-spacing: -0.5px; }
.page-desc { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ===== Kartlar ===== */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.card-title { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; }
.card-subtitle { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ===== Grid ===== */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-2 { grid-template-columns: 1fr 2fr; }

/* ===== Stat kartları ===== */
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat-card .stat-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; margin-bottom: 14px; font-size: 18px;
}
.stat-icon.indigo { background: var(--accent-soft); color: var(--accent); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.amber { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-card .stat-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-card .stat-value { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; margin-top: 2px; font-family: var(--display); }
.stat-card .stat-change { font-size: 11px; font-weight: 600; margin-top: 4px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }
.stat-change.neutral { color: var(--muted); }

/* ===== Tablolar ===== */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th {
  text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted);
  border-bottom: 1px solid var(--border); white-space: nowrap; cursor: pointer; user-select: none;
}
.data-table thead th:hover { color: var(--ink); }
.data-table tbody td {
  padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .cell-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.data-table .cell-actions button { white-space: nowrap; }

/* Ürün hücresi */
.prod-cell { display: flex; align-items: center; gap: 12px; }
.prod-thumb {
  width: 42px; height: 42px; border-radius: 9px; object-fit: cover;
  flex-shrink: 0; background: var(--surface-2); border: 1px solid var(--border);
}
.prod-thumb[src*="logo.png"] { object-fit: contain; padding: 5px; }
.prod-name { font-weight: 600; color: var(--ink); }
.prod-sub { font-size: 11px; color: var(--muted); }

/* ===== Butonlar ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--ink); color: #fff; border-radius: 9px;
  padding: 9px 14px; font-size: 13px; font-weight: 600; transition: 0.12s; white-space: nowrap;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-outline {
  background: transparent; color: var(--ink); border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--surface-2); transform: none; }
.btn-danger { background: var(--danger); }
.btn-danger-soft { background: var(--danger-bg); color: var(--danger); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 7px; }
.btn-icon {
  width: 30px; height: 30px; border-radius: 7px; display: inline-grid; place-items: center;
  color: var(--muted); transition: 0.12s; font-size: 14px;
}
.btn-icon:hover { background: var(--surface-2); color: var(--ink); }
.btn-icon.danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ===== Badges ===== */
.pill {
  display: inline-block; padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.pill.green { background: var(--success-bg); color: var(--success); }
.pill.red { background: var(--danger-bg); color: var(--danger); }
.pill.amber { background: var(--warning-bg); color: var(--warning); }
.pill.blue { background: var(--info-bg); color: var(--info); }
.pill.gray { background: var(--surface-2); color: var(--muted); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.indigo { background: #eef2ff; color: #4f46e5; }

/* ===== Form ===== */
.form-grid { display: grid; gap: 16px; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field input, .field textarea, .field select {
  border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px;
  font-size: 13px; background: var(--bg); transition: 0.15s; width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface);
}
.field textarea { resize: vertical; min-height: 80px; }
.field .hint { font-size: 11px; color: var(--muted); }
.checkbox-field { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.checkbox-field input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ===== Form araçları ===== */
.form-section { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.form-section-title { font-size: 13px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }

/* ===== Modal ===== */
.modal {
  position: fixed; inset: 0; z-index: 600; background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(2px);
}
.modal-box {
  background: var(--surface); border-radius: var(--radius-lg); width: 640px;
  max-width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal-box.modal-lg { width: 860px; }
.modal-box.modal-sm { width: 440px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-title { font-size: 16px; font-weight: 700; font-family: var(--display); letter-spacing: -0.3px; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  color: var(--muted); font-size: 18px; transition: 0.12s;
}
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
.modal-body { padding: 22px; }
.modal-foot {
  padding: 16px 22px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0; background: var(--surface);
}

/* ===== Toast ===== */
.admin-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 900;
  background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: 10px; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px);
  transition: 0.25s; pointer-events: none;
}
.admin-toast.show { opacity: 1; transform: translateY(0); }
.admin-toast.error { background: var(--danger); color: #fff; }

/* ===== Pagination ===== */
.pagination { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pagination button {
  min-width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 13px; color: var(--ink-2); transition: 0.12s;
  background: var(--surface);
}
.pagination button:hover:not(:disabled) { background: var(--surface-2); }
.pagination button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .page-info { font-size: 12px; color: var(--muted); margin-left: 6px; }

/* ===== Charts ===== */
.chart-box { position: relative; height: 300px; }
.chart-box-sm { height: 220px; }

/* ===== Boş durum ===== */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .empty-icon { font-size: 40px; margin-bottom: 10px; }
.empty h3 { color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.empty p { font-size: 13px; }

/* ===== Bildirim/alert ===== */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-bottom: 12px;
}
.alert.warning { background: var(--warning-bg); color: var(--warning); }
.alert.danger { background: var(--danger-bg); color: var(--danger); }
.alert.info { background: var(--info-bg); color: var(--info); }
.alert .alert-title { font-weight: 700; display: block; }
.alert .alert-desc { font-size: 12px; opacity: 0.9; }

/* ===== Kargo timeline ===== */
.shipment-timeline { position: relative; padding-left: 24px; }
.shipment-timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.shipment-event { position: relative; padding-bottom: 18px; }
.shipment-event:last-child { padding-bottom: 0; }
.shipment-dot {
  position: absolute; left: -24px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--muted);
}
.shipment-dot.done { background: var(--success); border-color: var(--success); }
.shipment-body .shipment-status { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.shipment-body .shipment-status small { color: var(--muted); font-weight: 400; }
.shipment-body .shipment-loc { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.shipment-body .shipment-note { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-style: italic; }

/* ===== Varyant grid ===== */
.variant-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 36px; gap: 8px;
  margin-bottom: 8px; align-items: center;
}

/* ===== Sipariş detay ===== */
.detail-section { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.detail-section h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 12px; }
.detail-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.detail-row span { color: var(--muted); }
.detail-row b { font-weight: 600; text-align: right; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-toggle { display: grid; }
  .content { margin-left: 0; padding: 20px 16px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .topbar-search { width: 160px; }
  .user-meta { display: none; }
  .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .variant-row { grid-template-columns: 1fr 1fr; }
  .modal-box { width: 100%; }
}