/*
  app.css — Pazaryeri Entegrasyon Sistemi arayüz stili.

  Tasarım yönü: genel bir "admin panel" şablonu değil; konunun kendisinden
  (barkod, kargo, stok, çoklu kanal) türetilmiş sakin ve hızlı okunur bir
  operasyon konsolu. İmza öge: barkod çizgileri (sol üstteki marka alanında
  ve boş durum ekranlarında) — dekoratif değil, ürünün kendi doğasından.
*/

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;600&display=swap');

:root {
  --ink: #161B26;
  --ink-soft: #5B6472;
  --paper: #F3F4F7;
  --surface: #FFFFFF;
  --line: #E2E5EB;
  --brand: #0E6E55;
  --brand-dark: #0A5643;
  --brand-ink: #FFFFFF;
  --brand-tint: #E4F3EE;
  --amber: #8A5A12;
  --amber-tint: #FBF0DD;
  --red: #B42318;
  --red-tint: #FCEAE8;
  --sidebar: #10151F;
  --sidebar-line: #232B3B;
  --sidebar-ink: #A9B2C3;
  --sidebar-ink-active: #FFFFFF;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 21, 31, 0.06), 0 1px 8px rgba(16, 21, 31, 0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand-mark, .stat-value {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 4px;
}

code, .mono, .data-code, td.num, th.num {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

a { color: var(--brand-dark); }

@media (prefers-reduced-motion: no-preference) {
  .app-main { animation: rise 0.32s ease both; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- Kabuk (shell) düzeni ---------- */

.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  width: 236px;
  flex-shrink: 0;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--sidebar-line);
}

/* İmza öge: barkod çizgileri — genişlik dizisi kasıtlı olarak düzensiz (gerçek bir
   barkodun görünümünü andırsın diye), tek bir yerde ve ölçülü kullanılır. */
.barcode-mark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 26px;
  flex-shrink: 0;
}
.barcode-mark span {
  display: block;
  width: 3px;
  background: var(--brand);
  border-radius: 1px;
}
.barcode-mark span:nth-child(1) { height: 100%; width: 4px; }
.barcode-mark span:nth-child(2) { height: 60%; }
.barcode-mark span:nth-child(3) { height: 85%; width: 2px; }
.barcode-mark span:nth-child(4) { height: 45%; }
.barcode-mark span:nth-child(5) { height: 100%; width: 3px; }
.barcode-mark span:nth-child(6) { height: 70%; width: 2px; }
.barcode-mark span:nth-child(7) { height: 90%; }

.brand-mark { color: #fff; font-size: 15px; line-height: 1.2; }
.brand-mark small { display: block; font-family: 'Inter'; font-weight: 400; font-size: 11px; color: var(--sidebar-ink); }

.nav-group { margin-bottom: 18px; }
.nav-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6B7385;
  padding: 0 10px;
  margin-bottom: 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--sidebar-ink);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
}
.nav-link:hover { background: rgba(255,255,255,0.06); color: var(--sidebar-ink-active); }
.nav-link.active { background: var(--brand); color: #fff; }
.nav-link .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--sidebar-line);
  font-size: 12.5px;
}
.sidebar-footer form { margin-top: 8px; }
.sidebar-footer button {
  background: none; border: 1px solid var(--sidebar-line); color: var(--sidebar-ink);
  border-radius: 8px; padding: 6px 10px; font-size: 12.5px; cursor: pointer; width: 100%;
}
.sidebar-footer button:hover { color: #fff; border-color: #3a445c; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.app-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.app-topbar h1 { font-size: 19px; }
.app-topbar .subtitle { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

.app-content { padding: 24px 28px 48px; max-width: 1180px; width: 100%; }

/* ---------- Bileşenler ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.card h2 { font-size: 15px; margin-bottom: 14px; }
.card-flush { padding: 0; overflow: hidden; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-label { font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.stat-value { font-size: 24px; }
.stat-value.mono { font-family: 'IBM Plex Mono', monospace; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none;
  font-family: inherit;
}
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: #c7cbd4; }
.btn-danger { background: var(--red-tint); color: var(--red); }
.btn-danger:hover { background: #f8d9d6; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .filters { display: flex; gap: 8px; flex-wrap: wrap; }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-soft); padding: 10px 16px; border-bottom: 1px solid var(--line); background: #FAFBFC;
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13.5px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FAFBFC; }
td.num, th.num { text-align: right; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #EEF0F3; color: var(--ink-soft);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--brand-tint); color: var(--brand-dark); }
.badge-warning { background: var(--amber-tint); color: var(--amber); }
.badge-danger  { background: var(--red-tint); color: var(--red); }
.badge-neutral { background: #EEF0F3; color: var(--ink-soft); }

.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-row .hint { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

input[type=text], input[type=number], input[type=email], input[type=password], input[type=search], input[type=date],
select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 13.5px; background: var(--surface); color: var(--ink);
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; }
.alert-success { background: var(--brand-tint); color: var(--brand-dark); }
.alert-error   { background: var(--red-tint); color: var(--red); }
.alert-warning { background: var(--amber-tint); color: var(--amber); }

.empty-state {
  text-align: center; padding: 48px 20px; color: var(--ink-soft);
}
.empty-state .barcode-mark { justify-content: center; margin: 0 auto 14px; opacity: .35; }
.empty-state h3 { color: var(--ink); font-size: 15px; margin-bottom: 6px; }
.empty-state p { max-width: 360px; margin: 0 auto; font-size: 13px; }

.helper-box { background: var(--paper); border: 1px dashed var(--line); border-radius: 8px; padding: 14px 16px; font-size: 12.5px; color: var(--ink-soft); }

.pagination { display: flex; gap: 6px; margin-top: 16px; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line);
  color: var(--ink-soft); text-decoration: none; font-size: 12.5px;
}
.pagination a:hover { border-color: var(--brand); color: var(--brand-dark); }
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; }

.auth-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--sidebar); padding: 20px;
}
.auth-card {
  background: var(--surface); border-radius: 14px; padding: 36px 32px; width: 100%; max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.auth-card .barcode-mark { margin-bottom: 16px; }

@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .app-sidebar { width: 100%; flex-direction: row; align-items: center; padding: 12px 16px; overflow-x: auto; }
  .brand { border-bottom: none; padding: 0 12px 0 0; margin: 0 12px 0 0; border-right: 1px solid var(--sidebar-line); }
  .nav-group { display: flex; margin-bottom: 0; }
  .nav-label { display: none; }
  .nav-link { white-space: nowrap; }
  .sidebar-footer { display: none; }
  .app-content { padding: 18px 16px 40px; }
  .app-topbar { padding: 14px 16px; }
}
