:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --border: #e3e8ef;
  --text: #1c2733;
  --muted: #6b7a8c;
  --primary: #0e7490;
  --primary-dark: #0b5e76;
  --accent: #f59e0b;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--danger); }
.spacer { flex: 1; }

/* ---------- Giriş ekranı ---------- */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 32px;
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.login-logo { font-size: 42px; }
.login-card h1 { margin: 8px 0 4px; font-size: 20px; }
.login-card input { margin: 12px 0; width: 100%; }

/* ---------- Üst bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-logo { font-size: 22px; }
.brand-name { font-weight: 700; font-size: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--success); }
.dot-err { background: var(--danger); }
.dot-warn { background: var(--accent); }

/* ---------- Sekmeler ---------- */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  overflow-x: auto;
}
.tab {
  border: none;
  background: none;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

main { max-width: 1280px; margin: 0 auto; padding: 20px; }

.tab-panel { animation: fadein 0.15s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Araç çubuğu ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }

/* ---------- Girdiler ve butonlar ---------- */
.input, select.input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 14px;
  color: var(--text);
}
.input:focus { outline: 2px solid rgba(14, 116, 144, 0.25); border-color: var(--primary); }

.btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s;
}
.btn:hover { background: #eef2f7; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: #fef2f2; border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: #fee2e2; }
.btn-success { background: #f0fdf4; border-color: #bbf7d0; color: var(--success); }
.btn-success:hover { background: #dcfce7; }
.btn-ghost { border: none; background: none; color: var(--muted); }
.btn-ghost:hover { background: #eef2f7; color: var(--text); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 4px 8px; font-size: 12px; border-radius: 6px; }

/* ---------- Tablolar ---------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  box-shadow: var(--shadow);
}
.table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #fafbfd;
  position: sticky;
  top: 0;
}
.table td { padding: 9px 12px; border-bottom: 1px solid #f1f4f8; vertical-align: middle; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }
.pm-toolbar { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.pm-toolbar select { min-width: 240px; }
.pm-table { min-width: 0; }
.pm-table th, .pm-table td { white-space: nowrap; }
.pm-edit { width: 96px; padding: 4px 8px; font-size: 13px; }
.pm-cs-row { background: #f0f9ff; }
.pm-cs-row:hover { background: #e8f4ff !important; }
.prod-filter { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.prod-filter summary { cursor: pointer; font-weight: 600; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 12px; margin: 10px 0; }
.filter-grid label { font-size: 11px; }
.filter-range { display: flex; align-items: center; gap: 4px; }
.filter-range input { width: 70px; }
.filter-checks { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.row-selected { background: #f0f9ff !important; }
.pmb-group td:first-child { border-left: 3px solid #93c5fd; }
.pmb-empty td { padding-top: 2px !important; padding-bottom: 2px !important; font-size: 12px; }
.thumb { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; background: #eef2f7; }
.thumb-placeholder { width: 36px; height: 36px; border-radius: 6px; background: #eef2f7; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 16px; }

/* ---------- Rozetler ---------- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.badge-green { background: #f0fdf4; color: var(--success); }
.badge-gray { background: #f1f5f9; color: var(--muted); }
.badge-blue { background: #eff6ff; color: #2563eb; }
.badge-amber { background: #fffbeb; color: #b45309; }
.badge-red { background: #fef2f2; color: var(--danger); }
.badge-cyan { background: #ecfeff; color: var(--primary); }

/* ---------- Sayfalama ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 14px; }

/* ---------- Ağaç (kategoriler) ---------- */
.tree {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.tree ul { list-style: none; padding-left: 18px; margin: 2px 0; }
.tree li { padding: 3px 0; }
.tree-node { cursor: pointer; user-select: none; }
.tree-node:hover { color: var(--primary); }
.tree-toggle { display: inline-block; width: 16px; color: var(--muted); }
.tree-id { color: var(--muted); font-size: 11px; margin-left: 6px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--text);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 100;
  max-width: 380px;
}
.toast.ok { background: var(--success); }
.toast.err { background: var(--danger); }
.toast.info { background: var(--primary); }

/* ---------- Modal ---------- */
.modal {
  border: none;
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  max-width: 520px;
  width: calc(100vw - 32px);
}
.modal::backdrop { background: rgba(15, 23, 42, 0.4); }
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; max-height: 60vh; overflow: auto; }
.modal-body label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 4px; }
.modal-body input, .modal-body textarea, .modal-body select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
.modal-body textarea { min-height: 90px; resize: vertical; }
.modal-body label.chk {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  margin: 12px 0 4px;
  cursor: pointer;
  line-height: 1.5;
}
.modal-body label.chk input { accent-color: #16a34a; width: 15px; height: 15px; flex-shrink: 0; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.prod-preview {
  margin: 8px 0 4px;
  border: 1px solid #e2d8c6;
  border-radius: 8px;
  background: #fffdf7;
  overflow: hidden;
}
.prod-preview summary {
  cursor: pointer;
  padding: 8px 10px;
  font-weight: 600;
  font-size: 14px;
  background: #faf4e8;
}
.prod-card-preview {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid #eee3cf;
}
.form-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border-bottom: 2px solid var(--primary, #1e5a8a);
  margin: 10px 0 12px;
}
.form-tab {
  border: 1px solid var(--border, #d0d7de);
  border-bottom: none;
  background: #f0f3f6;
  padding: 6px 12px;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #444;
}
.form-tab:hover {
  background: #e3e9f0;
}
.form-tab.active {
  background: var(--primary, #1e5a8a);
  color: #fff;
  border-color: var(--primary, #1e5a8a);
}
.form-tab-panel {
  display: none;
}
.form-tab-panel.active {
  display: block;
}
.cost-calc {
  margin: 10px 0 4px;
  border: 1px solid #d8e2ef;
  border-radius: 8px;
  background: #f8fbff;
  overflow: hidden;
}
.cost-calc summary {
  cursor: pointer;
  padding: 8px 10px;
  font-weight: 600;
  font-size: 14px;
  background: #eef4fb;
}
.cost-calc .cost-result {
  padding: 6px 10px;
  line-height: 1.6;
}
.cost-calc .code-suggest-row {
  padding: 0 10px 10px;
  margin: 0;
}
.cost-calc .form-row {
  padding: 0 10px;
  margin-top: 8px;
}
.char-counter {
  display: block;
  text-align: right;
  margin: -2px 0 4px;
}
.attr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  border: 1px solid var(--border, #d0d7de);
  border-radius: 6px;
  overflow: hidden;
}
.attr-table th {
  background: #eef2f6;
  text-align: left;
  padding: 6px 10px;
  font-weight: 600;
  border-bottom: 1px solid var(--border, #d0d7de);
}
.attr-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #eef0f2;
  vertical-align: middle;
}
.attr-table tr:last-child td {
  border-bottom: none;
}
.attr-table .attr-name {
  font-weight: 500;
  width: 45%;
}
.attr-table .req-col {
  text-align: center;
  width: 60px;
}
.attr-req-star {
  color: #c0392b;
  font-weight: 700;
  font-size: 15px;
}
.catmap-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0;
}
.catmap-main {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 260px;
  flex: 1;
}
.catmap-codes {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.catmap-codes .muted {
  font-weight: 600;
  font-size: 11px;
}
.catmap-code {
  width: 92px;
  padding: 4px 6px;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  font-size: 12px;
}
.profit-table-wrap {
  margin-top: 8px;
}
.profit-table th {
  background: #2c3e50;
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.profit-table td {
  white-space: nowrap;
}
.profit-cell {
  width: 64px;
  padding: 3px 6px;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  font-size: 13px;
}
.profit-table .ok {
  color: #1e8e3e;
  font-weight: 600;
}
.profit-table .err {
  color: #c0392b;
  font-weight: 600;
}

.pv-img {
  width: 88px;
  height: 112px;
  flex: 0 0 88px;
  border-radius: 6px;
  overflow: hidden;
  background: #f2ead9;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e6dcc8;
}
.pv-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pv-noimg {
  font-size: 30px;
  opacity: 0.6;
}
.pv-body {
  flex: 1;
  min-width: 0;
}
.pv-name {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
}
.pv-cat {
  font-size: 12px;
  color: #8a6d3b;
  margin: 2px 0 6px;
}
.pv-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.pv-price {
  font-size: 18px;
  font-weight: 800;
  color: #c2185b;
}
.pv-list {
  font-size: 13px;
  color: #999;
  text-decoration: line-through;
}
.pv-badge {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #2e7d32;
  padding: 1px 6px;
  border-radius: 10px;
}
.pv-meta {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}
.pv-status {
  color: #b26a00;
  font-weight: 700;
}
.pv-desc {
  font-size: 12px;
  color: #777;
  margin-top: 4px;
  line-height: 1.4;
}

.bulk-check-cell {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bulk-check {
  width: 15px;
  height: 15px;
  accent-color: #c2185b;
  cursor: pointer;
}

.bulk-history-filters {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid #e2d8c6;
  border-radius: 8px;
  background: #fdf9f2;
}
.bulk-history-filters label {
  display: block;
  margin-bottom: 2px;
}
.bulk-history-filters input[type='date'],
.bulk-history-filters select {
  padding: 5px 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 13px;
  background: #fff;
}

.bulk-nav {
  margin: 0 0 8px;
  font-size: 12px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.bulk-nav a {
  color: #8a6d3b;
  text-decoration: none;
  border: 1px solid #e2d5b8;
  padding: 2px 8px;
  border-radius: 10px;
  background: #faf4e8;
}
.bulk-nav a:hover {
  background: #f3e9d3;
}

.prev-errors {
  margin-top: 3px;
  font-size: 11px;
  color: #a07d3a;
  line-height: 1.4;
  cursor: help;
}

.bulk-autoretry {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid #e8c96a;
  border-left: 4px solid #e0a800;
  background: #fff8e1;
  border-radius: 6px;
  font-size: 13px;
}
.bulk-autoretry a {
  color: #8a6d3b;
}

.code-suggest-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 6px 0 10px;
  min-height: 22px;
}

.form-row { display: flex; gap: 10px; }
.form-row > div { flex: 1; }
.batch-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  margin: 10px 0;
  word-break: break-all;
}

/* ---------- Görsel yükleme ---------- */
.img-upload {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #fafbfd;
}
.img-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  min-height: 36px;
  align-items: center;
}
.img-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}
.img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.img-thumb .img-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  line-height: 16px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.img-thumb .img-remove:hover { background: var(--danger); }
.img-thumb .img-err {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fef2f2;
  color: var(--danger);
  font-weight: 700;
  font-size: 18px;
}
.img-thumb.uploading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.75);
}
.img-spin {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 1;
}
@keyframes spin { to { transform: rotate(360deg); } }
.img-upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}
.img-upload-row input[type='file'] {
  font-size: 12px;
  flex: 1;
  min-width: 160px;
}
.img-upload-row .img-url {
  flex: 2;
  min-width: 180px;
}

/* Barkod fiyat araştırması */
.barcode-wrap { flex: 1; min-width: 0; }
.barcode-row { display: flex; gap: 6px; }
.barcode-row input { flex: 1; min-width: 0; }
#c-price-research-box { margin-top: 6px; line-height: 1.7; }
#c-price-research-box .pr-img {
  max-width: 56px; max-height: 80px; object-fit: cover;
  border-radius: 6px; float: left; margin: 0 10px 4px 0; border: 1px solid var(--border);
}
#c-price-research-box .pr-title { margin-bottom: 4px; }
#c-price-research-box .pr-prices { margin-top: 2px; }
#c-price-research-box .pr-price { margin-right: 4px; }
#c-price-research-box .pr-actions { margin-top: 4px; }

/* Kamera ile barkod tarama */
.scan-box {
  margin-top: 8px;
}
.scan-box video {
  width: 100%;
  max-width: 400px;
  border-radius: 8px;
  background: #000;
  display: block;
}
.scan-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* Aynı yazardan kitap önerileri */
.isbn-sugs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 6px;
  margin-top: 4px;
}
.isbn-sug {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
}
.isbn-sug img {
  width: 34px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  background: #fff;
  flex-shrink: 0;
}
.isbn-sug-noimg {
  width: 34px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  border-radius: 4px;
  flex-shrink: 0;
}
.isbn-sug-info {
  flex: 1;
  min-width: 0;
}
.isbn-sug-title {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Kategori kuralları (yazar/yayınevi → kategori) */
.rule-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
  background: var(--bg-soft);
}
.rule-card h3 {
  margin: 0 0 4px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rule-add {
  display: flex;
  gap: 8px;
  margin: 10px 0;
  flex-wrap: wrap;
}
.rule-add .rule-match {
  flex: 1;
  min-width: 180px;
}
.rule-add .rule-cat {
  flex: 1;
  min-width: 180px;
}
.rule-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rule-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.rule-row code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* "Neden bu kategori?" — eşleşen sinyaller */
.isbn-why {
  margin-top: 6px;
  font-size: 12px;
}
.isbn-why summary {
  cursor: pointer;
  color: var(--muted);
  user-select: none;
}
.isbn-why summary:hover {
  color: var(--text);
}
.isbn-why ul {
  margin: 6px 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Kategoriye özel özellikler */
.cat-rules {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #e6d9c4;
  border-left: 3px solid #c2185b;
  background: #fdf9f2;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
}

/* Aynı ISBN'li ürün mağazada zaten var — uyarı kutusu */
.isbn-dup {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #f5d5b8;
  border-left: 3px solid #d97706;
  background: #fff7ed;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: #7c2d12;
}
.isbn-dup code {
  background: #fef3e2;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

#c-attrs {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
}
.attrs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.attr-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.attr-row label {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.attr-row select,
.attr-row .attr-search {
  width: 100%;
}
.attr-required label {
  color: var(--danger, #b91c1c);
}
.attr-invalid {
  border-color: var(--danger, #b91c1c) !important;
}

/* ---------- Kategori seçici (ürün oluşturma) ---------- */
.cat-picker { position: relative; }
.cat-drop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 220px;
  overflow: auto;
  z-index: 20;
  box-shadow: 0 6px 20px rgba(16, 24, 40, 0.15);
}
.cat-opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.cat-opt:hover { background: #eef2f7; }
.cat-opt + .cat-opt { border-top: 1px solid #f1f4f8; }

/* ---------- Toplu stok/fiyat güncelleme ---------- */
.bulk-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 8px;
  font-size: 13px;
}
.bulk-table-wrap {
  max-height: 38vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.bulk-table { min-width: 840px; }
.bulk-table th, .bulk-table td { white-space: nowrap; }
.bulk-table td:nth-child(6), .bulk-table td:nth-child(7) { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-table th {
  position: sticky;
  top: 0;
  background: #fafbfd;
  z-index: 1;
}
.bulk-table td { padding: 6px 10px; font-size: 13px; }
.bulk-table .bulk-invalid { background: #fefaf9; }
.bulk-table .bulk-invalid td:first-child { box-shadow: inset 3px 0 0 var(--danger); }

/* ---------- Taslak kitap listesi ---------- */
.draft-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.draft-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.draft-thumb {
  width: 44px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}
.draft-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--bg-soft);
}
.draft-info { flex: 1; min-width: 0; }
.draft-title {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.draft-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ---------- Cevap ---------- */
.empty-state { text-align: center; padding: 32px; color: var(--muted); }

/* ---------- 🏭 Depo Girişi ---------- */
.depo-layout { display: grid; grid-template-columns: 400px 1fr; gap: 18px; align-items: start; }
.depo-left, .depo-right {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.depo-left .form-grid { display: grid; grid-template-columns: 90px 1fr; gap: 8px 10px; align-items: center; }
.depo-left .form-grid label { font-size: 13px; color: var(--muted); text-align: right; }
.depo-left .form-grid .input { width: 100%; }
.btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.depo-search { display: flex; gap: 8px; align-items: center; }
.depo-search .input { flex: 1; }
.model-change {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.model-change .form-grid { display: grid; grid-template-columns: 110px 1fr; gap: 8px 10px; align-items: center; }
.model-change .form-grid label { font-size: 13px; color: var(--muted); text-align: right; }
.model-change .form-grid .input { width: 100%; }
#dg-lines td { font-size: 13px; }
#dg-lines .input { padding: 4px 6px; font-size: 13px; }
.dg-status .badge-gray { font-size: 11px; }
/* Siparişler — masaüstü uygulama düzeni */
.orders-filter {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.of-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  align-items: flex-end;
}
.of-row2 { margin-top: 10px; align-items: center; justify-content: space-between; }
.of-field { display: flex; flex-direction: column; gap: 3px; }
.of-field label { font-size: 12px; color: var(--muted); }
.of-field .input { min-width: 150px; }
.of-date { display: flex; align-items: center; gap: 6px; }
.of-date .input { min-width: 140px; }
.shop-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.shop-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 12px;
  cursor: pointer;
  background: #f8fafc;
  user-select: none;
  white-space: nowrap;
}
.shop-chip.on { border-color: #3b82f6; background: #eff6ff; }
.shop-chip input { margin: 0; }
.shop-chip[title] { opacity: 0.55; cursor: not-allowed; }
.orders-stats {
  font-size: 13px;
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 2px 26px;
  line-height: 1.6;
}
.orders-stats b { font-size: 14px; }
.of-actions { display: flex; align-items: center; gap: 14px; }
.of-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.order-detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px 14px;
  font-size: 13px;
}
@media (max-width: 900px) {
  .of-row { flex-direction: column; align-items: stretch; }
  .of-row2 { flex-direction: column; align-items: stretch; gap: 10px; }
  .orders-stats { grid-template-columns: 1fr; }
}

/* Satış (POS) */
.satis-layout { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
.satis-left { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.satis-right { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.satis-left .form-grid { display: grid; grid-template-columns: 100px 1fr; gap: 8px 10px; align-items: center; }
.satis-left .form-grid label { font-size: 13px; color: var(--muted); text-align: right; }
.satis-left .form-grid .input { width: 100%; }
.satis-firma-row { display: flex; gap: 6px; }
.satis-firma-row .input { flex: 1; }
.st-stock-num { font-size: 20px; font-weight: 700; color: #c00; }
.st-image-box {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fafafa;
  overflow: hidden;
}
.st-image-box img { max-width: 100%; max-height: 260px; object-fit: contain; }
#st-sales td { font-size: 13px; }
#st-sales .input { padding: 4px 6px; font-size: 13px; }
@media (max-width: 1100px) {
  .depo-layout { grid-template-columns: 1fr; }
  .satis-layout { grid-template-columns: 1fr; }
}
