/* Akten Barkod Modülü — CSS v2 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:  #1E3A5C;
  --accent:   #2563EB;
  --success:  #16A34A;
  --warn:     #D97706;
  --danger:   #DC2626;
  --bg:       #F0F4F8;
  --card:     #FFFFFF;
  --border:   #E2E8F0;
  --text:     #1E293B;
  --muted:    #64748B;
  --sidebar-w: 196px;
  --radius:   10px;
  --shadow:   0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
}

.hidden { display: none !important; }

/* ─── Layout ─── */
#app { display: block; min-height: 100vh; }

/* ─── Sidebar ─── */
.sidebar {
  background: var(--primary);
  color: #CBD5E1;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0;
  height: 100vh; width: var(--sidebar-w);
  overflow-y: auto; z-index: 100;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-header {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 18px 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-title { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: 0.2px; }
.sidebar-subtitle { font-size: 10px; color: rgba(255,255,255,0.55); margin-top: 1px; }

.nav-list { list-style: none; padding: 6px 0; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; color: #fff;
  text-decoration: none; font-size: 13px;
  transition: background 0.15s, color 0.15s;
  position: relative; white-space: nowrap;
}
.nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-item.active {
  background: rgba(255,255,255,0.13); color: #fff;
  border-left: 3px solid #60A5FA; padding-left: 11px;
}
.nav-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.badge {
  background: var(--warn); color: #fff; font-size: 10px;
  padding: 1px 5px; border-radius: 8px; margin-left: auto; flex-shrink: 0;
}

.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,0.07); }
.btn-logout {
  width: 100%; background: transparent;
  border: 1px solid rgba(255,255,255,0.18); color: rgba(255,255,255,0.6);
  padding: 7px; border-radius: 7px; cursor: pointer; font-size: 12px; transition: all 0.15s;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); color: #fff; }

.user-info {
  font-size: 11px; color: rgba(255,255,255,0.5); padding: 0 14px 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ─── Content ─── */
.content {
  margin-left: var(--sidebar-w);
  padding: 24px 28px;
  min-width: 0;
  max-width: calc(100vw - var(--sidebar-w));
}

/* ─── View Header ─── */
.view-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.view-header h2 {
  font-size: 18px; font-weight: 700; color: var(--primary);
  white-space: nowrap; flex-shrink: 0;
}
.view-desc { color: var(--muted); font-size: 12.5px; margin-bottom: 16px; line-height: 1.5; }
.header-actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }
.count-badge {
  background: var(--accent); color: #fff;
  font-size: 11px; padding: 2px 7px; border-radius: 10px; font-weight: 600;
}
.count-badge.warn { background: var(--warn); }

/* ─── Cards ─── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow);
}
.card-table { padding: 0; overflow: hidden; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-table .card-header { padding: 14px 18px; border-bottom: 1px solid var(--border); margin: 0; }
.card-header h3 { font-size: 14px; font-weight: 600; color: var(--text); }
.card-section-title {
  font-size: 10.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.8px;
  margin: 18px 0 10px; border-bottom: 1px solid var(--border); padding-bottom: 6px;
}

/* ─── Stats Grid ─── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 20px;
}
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--border); border-radius: var(--radius) var(--radius) 0 0;
}
.stat-card:nth-child(1)::after { background: var(--accent); }
.stat-card.stat-warn::after   { background: var(--warn); }
.stat-card.stat-success::after{ background: var(--success); }
.stat-value { font-size: 30px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat-link { display: inline-block; margin-top: 6px; font-size: 11px; color: var(--accent); text-decoration: none; }
.stat-warn .stat-value    { color: var(--warn); }
.stat-success .stat-value { color: var(--success); }
.dist-list { display: flex; flex-direction: column; gap: 6px; }
.dist-item { display: flex; align-items: center; gap: 8px; }
.dist-badge { color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 8px; font-weight: 600; }
.dist-count { font-size: 15px; font-weight: 700; }

/* ─── Table ─── */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  background: #F8FAFC; font-weight: 600; color: var(--muted);
  text-align: left; padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
  white-space: nowrap;
}
.table td {
  padding: 10px 14px; border-bottom: 1px solid #F1F5F9;
  vertical-align: middle; white-space: nowrap;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #FAFBFD; }
.table tr.selected td { background: #EFF6FF; }
.empty-td {
  text-align: center !important; color: var(--muted);
  padding: 48px 20px !important; white-space: normal !important;
  font-size: 14px;
}
.action-cell { display: flex; gap: 4px; }

code.barcode-code {
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px;
  background: #EEF2FF; padding: 2px 6px; border-radius: 4px; color: #1E40AF;
}

/* ─── Badges ─── */
.badge-tip { padding: 2px 8px; border-radius: 8px; font-size: 11px; font-weight: 600; color: #fff; white-space: nowrap; }
.badge-tip.ean13   { background: #2563EB; }
.badge-tip.code128 { background: #7C3AED; }
.badge-tip.qr      { background: #059669; }

.badge-durum { padding: 2px 8px; border-radius: 8px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-durum.taslak    { background: #FEF9C3; color: #854D0E; }
.badge-durum.eslestirdi{ background: #DBEAFE; color: #1E40AF; }
.badge-durum.aktif     { background: #DCFCE7; color: #166534; }
.badge-durum.pasif     { background: #F1F5F9; color: #64748B; }
.badge-durum.iptal     { background: #FEE2E2; color: #991B1B; }

/* ─── Filters ─── */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filter-input, .filter-select {
  padding: 7px 10px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 13px; background: var(--card);
  color: var(--text); height: 34px; transition: border-color 0.15s;
}
.filter-input:focus, .filter-select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.filter-search { flex: 1; min-width: 180px; }

/* ─── Bulk bar ─── */
.bulk-bar {
  background: #EFF6FF; border: 1px solid #BFDBFE;
  border-radius: var(--radius); padding: 10px 16px;
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.bulk-bar span { font-weight: 600; color: var(--accent); }

/* ─── Pagination ─── */
.pagination {
  display: flex; align-items: center; gap: 12px;
  justify-content: center; margin-top: 16px;
}
.pagination span { color: var(--muted); font-size: 13px; }

/* ─── Form ─── */
.form-layout { display: flex; gap: 20px; }
.form-card { flex: 1; min-width: 0; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.3px; }
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin-bottom: 12px;
}
.flex-2 { grid-column: span 2; }
.form-control {
  padding: 8px 11px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 13px; background: var(--card);
  color: var(--text); transition: border-color 0.15s;
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.form-control-sm { padding: 5px 9px; font-size: 12px; }
textarea.form-control { resize: vertical; }
.required { color: var(--danger); }
.field-msg { font-size: 12px; margin-top: 4px; }
.field-msg.success { color: var(--success); }
.field-msg.error   { color: var(--danger); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ─── Tip selector ─── */
.tip-selector { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.tip-option {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 7px 14px; border: 2px solid var(--border); border-radius: 7px; transition: all 0.15s;
}
.tip-option:has(input:checked) { border-color: var(--accent); background: #EFF6FF; }
.tip-label { font-weight: 600; font-size: 13px; }
.tip-option input { display: none; }
.mod-selector { display: flex; gap: 16px; margin-bottom: 12px; }
.mod-selector label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }

/* ─── Barcode preview ─── */
.barcode-preview-box { display: flex; align-items: center; gap: 10px; }
.barcode-preview-code { font-family: monospace; font-size: 14px; font-weight: 700; color: var(--primary); }
.barcode-preview-area {
  background: #F8FAFC; border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 14px; text-align: center;
  min-height: 90px; display: flex; align-items: center; justify-content: center; margin: 10px 0;
}
.barcode-preview-area svg    { max-width: 100%; }
.barcode-preview-area canvas { max-width: 100%; }
.input-with-action { display: flex; gap: 8px; }
.input-with-action input { flex: 1; }

/* ─── SKU Eşleştirme ─── */
.eslestir-table .sku-input { width: 100%; min-width: 140px; }

/* ─── Import ─── */
.drop-zone {
  border: 2px dashed #CBD5E1; border-radius: var(--radius);
  padding: 48px 32px; text-align: center; transition: all 0.2s; cursor: pointer;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--accent); background: #EFF6FF; }
.drop-zone-icon { font-size: 40px; margin-bottom: 10px; }
.drop-zone-text { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.drop-zone-hint { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.import-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.import-stat { padding: 6px 14px; border-radius: 7px; font-weight: 600; font-size: 13px; }
.import-stat.ok  { background: #DCFCE7; color: #166534; }
.import-stat.err { background: #FEE2E2; color: #991B1B; }
.import-stat.warn{ background: #FEF9C3; color: #854D0E; }
.error-details { margin-bottom: 12px; border: 1px solid #FCA5A5; border-radius: var(--radius); padding: 8px 12px; }
.error-details summary { cursor: pointer; font-weight: 600; color: var(--danger); }
.error-details ul { margin-top: 8px; padding-left: 20px; font-size: 12px; color: #7F1D1D; }

/* ─── Export grid ─── */
.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 16px; border-radius: 7px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.15s; white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled)   { background: #1D4ED8; }
.btn-secondary { background: var(--primary); color: #fff; }
.btn-secondary:hover:not(:disabled) { background: #162D47; }
.btn-outline   { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover:not(:disabled)   { background: #F8FAFC; border-color: #CBD5E1; }
.btn-ghost     { background: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled)     { background: #F1F5F9; color: var(--text); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled)    { background: #B91C1C; }
.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-xs  { padding: 4px 9px; font-size: 11px; }

/* ─── Modal ─── */
#modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-box {
  background: var(--card); border-radius: 12px; padding: 24px;
  max-width: 520px; width: 90%; max-height: 85vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header { margin-bottom: 20px; }
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ─── Toast ─── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: #1E293B; color: #fff; padding: 11px 18px;
  border-radius: 8px; font-size: 13px;
  opacity: 0; transform: translateY(8px); transition: all 0.25s;
  max-width: 300px; box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #064E3B; }
.toast-error   { background: #7F1D1D; }
.toast-warn    { background: #78350F; }

/* ─── Loading ─── */
.loading { display: flex; align-items: center; justify-content: center; padding: 80px; }
.spinner {
  width: 28px; height: 28px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Empty state ─── */
.empty-state { text-align: center; padding: 52px 20px; color: var(--muted); font-size: 14px; }
.empty-state.success { color: var(--success); font-weight: 500; }

/* ─── Misc ─── */
.muted { color: var(--muted); }
details summary { user-select: none; }

/* ─── Responsive ─── */
@media (max-width: 1000px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-196px); }
  .content { margin-left: 0; padding: 16px; max-width: 100vw; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .view-header h2 { font-size: 16px; }
}
