/* ========================================================
   DEPO WMS v2.0 — SAHA KULLANICISI TASARIMI
   Font Awesome 6 + Büyük Butonlar + Hızlı Erişim
   ======================================================== */

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  max-width: 100vw;
}
a { color: #C41428; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; }
/* Inter için letter-spacing ayarı */
h1,h2,h3,h4,h5,h6,.page-title,.card-header { letter-spacing: -.25px; }
.btn { letter-spacing: -.1px; }

/* ===== DESIGN TOKENS ===== */
:root {
  --primary:       #C41428;
  --primary-d:     #A01020;
  --primary-dd:    #7B0D1E;
  --primary-l:     #FDE8EB;
  --primary-xl:    #FFF5F6;

  --success:       #16a34a;
  --success-l:     #dcfce7;
  --danger:        #dc2626;
  --danger-l:      #fee2e2;
  --warning:       #d97706;
  --warning-l:     #fef3c7;
  --info:          #0284c7;
  --info-l:        #e0f2fe;

  --bg:            #f1f5f9;
  --surface:       #ffffff;
  --border:        #e2e8f0;
  --border-d:      #cbd5e1;

  --text:          #1e293b;
  --text-sm:       #475569;
  --text-xs:       #94a3b8;

  --navbar-h:      62px;
  --sidebar-w:     280px;
  --bottom-h:      72px;

  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-2xl:  24px;
  --r-full: 9999px;

  --sh-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --sh-md:  0 4px 12px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --sh-lg:  0 10px 28px rgba(0,0,0,.09), 0 4px 8px rgba(0,0,0,.06);
  --sh-xl:  0 20px 40px rgba(0,0,0,.12);

  --trans:  .15s ease;
}

/* ===== TOPBAR (beyaz, profesyonel) ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--navbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 16px;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-size: 1rem; font-weight: 800;
  text-decoration: none; letter-spacing: -.3px;
}
.navbar-brand .brand-icon {
  width: 34px; height: 34px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .95rem; flex-shrink: 0;
}
.navbar-brand .brand-text { line-height: 1.15; }
.navbar-brand .brand-sub { font-size: .65rem; font-weight: 400; color: #94a3b8; display: block; }
/* Sayfa başlığı - orta/sol */
.topbar-title {
  flex: 1;
  font-size: .95rem; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media(max-width:639px) { .topbar-title { display: none; } }
.navbar-right { display: flex; align-items: center; gap: 2px; margin-left: auto; }
/* Topbar icon butonları */
.nav-icon-btn {
  width: 38px; height: 38px;
  border: none; border-radius: 9px;
  background: transparent;
  color: #64748b; font-size: .95rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  position: relative; transition: background var(--trans), color var(--trans);
  flex-shrink: 0;
}
.nav-icon-btn:hover { background: #f1f5f9; color: var(--text); }
.nav-icon-btn:active { transform: scale(.93); }
/* Bildirim badge */
.notif-badge {
  position: absolute; top: 5px; right: 5px;
  background: var(--primary); color: #fff;
  font-size: .58rem; font-weight: 800;
  min-width: 15px; height: 15px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; border: 2px solid #fff;
  pointer-events: none;
}
/* Kullanıcı menü butonu (topbar sağ) */
.user-menu-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 8px 5px 5px; border-radius: 9px;
  background: none; border: none; cursor: pointer;
  transition: background var(--trans); color: var(--text);
}
.user-menu-btn:hover { background: #f1f5f9; }
.topbar-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-dd), var(--primary));
  color: #fff; font-size: .68rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; letter-spacing: -.5px;
}
.user-menu-name { font-size: .82rem; font-weight: 600; max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media(max-width:479px) { .user-menu-name { display: none; } }
/* Topbar dropdown paneller */
.topbar-drop-wrap { position: relative; }
.topbar-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 280px; max-width: 340px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xl);
  z-index: 500; display: none;
  animation: tdFadeIn .15s ease;
  overflow: hidden;
}
.topbar-dropdown.open { display: block; }
@keyframes tdFadeIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.td-header {
  padding: 13px 16px 10px;
  font-size: .72rem; font-weight: 800; color: #94a3b8; text-transform: uppercase; letter-spacing: .08em;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.td-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 16px;
  font-size: .86rem; color: var(--text);
  text-decoration: none; transition: background .1s;
  border-bottom: 1px solid #f8fafc;
  cursor: pointer;
}
.td-item:hover { background: #f8fafc; text-decoration: none; color: var(--text); }
.td-item:last-child { border-bottom: none; }
.td-item.danger:hover { background: #fef2f2; color: #dc2626; }
.td-icon { width: 32px; height: 32px; border-radius: 8px; display:flex; align-items:center; justify-content:center; font-size:.85rem; flex-shrink:0; }
.td-icon.ti-blue   { background: #eff6ff; color: #2563eb; }
.td-icon.ti-red    { background: #fef2f2; color: #dc2626; }
.td-icon.ti-green  { background: #f0fdf4; color: #16a34a; }
.td-icon.ti-gray   { background: #f8fafc; color: #64748b; }
.td-icon.ti-orange { background: #fff7ed; color: #c2410c; }
.td-icon.ti-purple { background: #f5f3ff; color: #6d28d9; }
.td-item-text { flex: 1; }
.td-item-label { font-weight: 600; font-size: .86rem; }
.td-item-sub { font-size: .75rem; color: #94a3b8; margin-top: 1px; }
.td-empty { padding: 24px 16px; text-align: center; color: #94a3b8; font-size: .86rem; }
.td-footer { padding: 10px 16px; border-top: 1px solid var(--border); text-align: center; }
.td-footer a { font-size: .8rem; color: var(--primary); font-weight: 600; text-decoration: none; }
.td-footer a:hover { text-decoration: underline; }
/* Eski uyumluluk */
.navbar-user { display: none; }

/* ===== SIDEBAR ===== */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(15,23,42,.55); backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }
.sidebar {
  position: fixed; top: 0; left: 0; z-index: 400;
  width: var(--sidebar-w); height: 100vh; overflow-y: auto;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  transform: translateX(calc(-1 * var(--sidebar-w)));
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.sidebar.open { transform: translateX(0); }
.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-logo { color: var(--primary); font-size: .95rem; font-weight: 800; }
.sidebar-close {
  width: 32px; height: 32px;
  background: #f1f5f9; border: none;
  color: #64748b; border-radius: 8px; cursor: pointer; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-user {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  background: #fafafa;
  display: flex; align-items: center; gap: 10px;
}
.sidebar-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary-dd), var(--primary));
  color: #fff; font-size: .82rem; font-weight: 800; letter-spacing: -.5px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-user-info { min-width: 0; flex: 1; }
.sidebar-user-info .user-name { color: #1e293b; font-weight: 700; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info .user-meta { color: #64748b; font-size: .72rem; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-chip {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 4px; padding: 2px 8px;
  border-radius: 20px; font-size: .68rem; font-weight: 700;
  background: rgba(196,20,40,.1); color: var(--primary);
  border: 1px solid rgba(196,20,40,.2);
}
.sidebar-nav { flex: 1; padding: 8px 8px; }
.nav-section-label {
  padding: 10px 8px 4px;
  color: #94a3b8; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; color: #475569;
  font-size: .9rem; font-weight: 500; text-decoration: none;
  border-radius: 10px; margin-bottom: 2px;
  transition: all var(--trans); position: relative;
}
.nav-item:hover { background: #f1f5f9; color: #1e293b; text-decoration: none; }
.nav-item.active {
  background: rgba(196,20,40,.08);
  color: var(--primary); font-weight: 600;
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: #C41428;
}
.ni { width: 20px; text-align: center; font-size: .95rem; flex-shrink: 0; }
.nav-item .nav-badge {
  margin-left: auto;
  background: #ef4444; color: #fff;
  font-size: .65rem; font-weight: 800;
  padding: 2px 7px; border-radius: 20px;
}
/* ===== ACCORDION SIDEBAR GROUPS ===== */
.nav-group-toggle {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  background: none; border: none; cursor: pointer;
  color: #64748b; font-size: .82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  border-radius: 8px; margin-bottom: 2px;
  transition: all .15s; text-align: left;
}
.nav-group-toggle:hover { background: #f1f5f9; color: #334155; }
.nav-group-toggle.open   { color: var(--primary); }
.nav-group-toggle span   { flex: 1; display: flex; align-items: center; gap: 12px; }
.nav-group-toggle .nav-arrow {
  font-size: .62rem; transition: transform .22s;
  color: #475569;
}
.nav-group-toggle.open .nav-arrow { transform: rotate(90deg); }
.nav-group {
  overflow: hidden;
  transition: max-height .25s cubic-bezier(.4,0,.2,1);
  padding-left: 8px;
}
.nav-item.nav-child {
  font-size: .87rem;
  padding: 9px 10px 9px 14px;
}
.nav-item.nav-child::before { left: 4px; }

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid #e2e8f0;
  background: #fafafa;
  display: flex; gap: 6px;
}
.sb-foot-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 9px 10px; border-radius: 9px;
  border: none; cursor: pointer; background: #f1f5f9;
  color: #64748b; font-size: .78rem; font-weight: 600;
  text-decoration: none; transition: background .15s, color .15s;
}
.sb-foot-btn:hover { background: #e2e8f0; color: #334155; text-decoration: none; }
.sb-foot-btn.sb-logout:hover { background: rgba(196,20,40,.1); color: var(--primary); }

/* ===== ANA LAYOUT ===== */
.app-layout { padding-top: var(--navbar-h); min-height: 100vh; }
.main-content {
  padding: 16px; max-width: 1140px; margin: 0 auto;
  padding-bottom: calc(var(--bottom-h) + 16px);
}

/* ===== SAYFA BAŞLIĞI ===== */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 12px; flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
}
.page-title {
  font-size: 1.25rem; font-weight: 800; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.page-title .pt-icon {
  width: 38px; height: 38px;
  background: var(--primary-l);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 1rem;
}
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== KARTLAR ===== */
.card {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--sh-sm); margin-bottom: 14px;
  overflow: hidden; border: 1px solid var(--border);
}
.card-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; font-size: .95rem; color: var(--text);
  background: var(--bg);
}
.card-header .ch-icon { color: var(--primary); margin-right: 6px; }
.card-body { padding: 18px; }
.card-footer {
  padding: 12px 18px; border-top: 1px solid var(--border);
  background: var(--bg);
}

/* ===== DASHBOARD - HIZLI ERİŞİM KARTLARI ===== */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.qa-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 118px; padding: 16px 12px;
  border-radius: var(--r-xl);
  text-decoration: none; color: #fff;
  text-align: center;
  position: relative; overflow: hidden;
  box-shadow: var(--sh-md);
  transition: transform var(--trans), box-shadow var(--trans);
  border: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.qa-card:hover { transform: translateY(-2px); box-shadow: var(--sh-lg); text-decoration: none; color: #fff; }
.qa-card:active { transform: scale(.96); }
.qa-card::after {
  content: '';
  position: absolute; top: -20px; right: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.qa-card .qa-icon {
  font-size: 2rem; margin-bottom: 8px;
  width: 52px; height: 52px;
  border-radius: var(--r-lg);
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.qa-card .qa-label { font-size: .9rem; font-weight: 800; letter-spacing: -.2px; line-height: 1.2; }
.qa-card .qa-sub {
  font-size: .72rem; opacity: .8; margin-top: 3px; font-weight: 500;
}
.qa-card .qa-count {
  position: absolute; top: 10px; right: 10px;
  background: rgba(255,255,255,.25);
  font-size: .68rem; font-weight: 800;
  padding: 2px 8px; border-radius: 20px;
  backdrop-filter: blur(4px);
}
/* QA Renkleri */
.qa-blue    { background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%); }
.qa-green   { background: linear-gradient(135deg, #15803d 0%, #16a34a 100%); }
.qa-sky     { background: linear-gradient(135deg, #0369a1 0%, #0ea5e9 100%); }
.qa-orange  { background: linear-gradient(135deg, #c2410c 0%, #f97316 100%); }
.qa-purple  { background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%); }
.qa-teal    { background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%); }
.qa-slate   { background: linear-gradient(135deg, #334155 0%, #475569 100%); }
.qa-amber   { background: linear-gradient(135deg, #92400e 0%, #d97706 100%); }
.qa-red     { background: linear-gradient(135deg, #991b1b 0%, #dc2626 100%); }
.qa-indigo  { background: linear-gradient(135deg, #3730a3 0%, #4f46e5 100%); }

/* ===== ÖZET KARTLARI ===== */
.stat-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-bottom: 16px;
}
.stat-card {
  background: var(--surface); border-radius: var(--r-lg);
  padding: 14px 16px; box-shadow: var(--sh-sm);
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.stat-icon {
  width: 44px; height: 44px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.stat-icon.si-blue   { background: var(--primary-l); color: var(--primary); }
.stat-icon.si-green  { background: var(--success-l); color: var(--success); }
.stat-icon.si-red    { background: var(--danger-l);  color: var(--danger);  }
.stat-icon.si-amber  { background: var(--warning-l); color: var(--warning); }
.stat-icon.si-purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.si-teal   { background: #ccfbf1; color: #0f766e; }
.stat-icon.si-yellow { background: #fef9c3; color: #854d0e; }
.stat-label { font-size: .75rem; color: var(--text-sm); font-weight: 500; }
.stat-value { font-size: 1.5rem; font-weight: 900; line-height: 1.1; color: var(--text); }
.stat-value.sv-danger { color: var(--danger); }
.stat-value.sv-warning { color: var(--warning); }
.stat-value.sv-success { color: var(--success); }

/* ===== ALT UYARI BANT ===== */
.alert-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: var(--r-lg);
  margin-bottom: 14px; font-size: .9rem; font-weight: 600;
  border-left: 4px solid;
}
.ab-danger  { background: var(--danger-l);  border-color: var(--danger);  color: #7f1d1d; }
.ab-warning { background: var(--warning-l); border-color: var(--warning); color: #78350f; }
.ab-success { background: var(--success-l); border-color: var(--success); color: #14532d; }
.ab-info    { background: var(--info-l);    border-color: var(--info);    color: #0c4a6e; }
.ab-icon { font-size: 1.1rem; flex-shrink: 0; }
.ab-text { flex: 1; }
.ab-action { font-size: .82rem; font-weight: 700; opacity: .8; }

/* ===== BUTONLAR ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--r-md);
  font-size: .95rem; font-weight: 700; cursor: pointer;
  border: 2px solid transparent; transition: all var(--trans);
  text-decoration: none; white-space: nowrap; line-height: 1;
  min-height: 46px;
}
.btn:active { transform: scale(.96); }
.btn-sm  { padding: 8px 14px; font-size: .82rem; min-height: 36px; }
.btn-lg  { padding: 14px 28px; font-size: 1rem; min-height: 52px; }
.btn-xl  { padding: 17px 32px; font-size: 1.08rem; min-height: 58px; border-radius: var(--r-lg); }
.btn-block { width: 100%; display: flex; }

.btn-primary {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); color: #fff; text-decoration: none; }

.btn-success {
  background: var(--success); color: #fff; border-color: var(--success);
}
.btn-success:hover { opacity: .9; color: #fff; text-decoration: none; }

.btn-danger {
  background: var(--danger); color: #fff; border-color: var(--danger);
}
.btn-danger:hover { opacity: .9; color: #fff; text-decoration: none; }

.btn-warning {
  background: var(--warning); color: #fff; border-color: var(--warning);
}
.btn-warning:hover { opacity: .9; color: #fff; text-decoration: none; }

.btn-secondary {
  background: var(--text-sm); color: #fff; border-color: var(--text-sm);
}
.btn-secondary:hover { opacity: .9; color: #fff; text-decoration: none; }

.btn-outline {
  background: transparent; color: var(--primary); border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; text-decoration: none; }

.btn-light {
  background: var(--bg); color: var(--text-sm); border-color: var(--border-d);
}
.btn-light:hover { background: var(--border); color: var(--text); text-decoration: none; }

.btn-white {
  background: #fff; color: var(--primary); border-color: var(--border);
  box-shadow: var(--sh-sm);
}
.btn-white:hover { background: var(--bg); text-decoration: none; color: var(--primary); }

/* ===== FORMLAR ===== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: .85rem; font-weight: 700;
  color: var(--text-sm); margin-bottom: 6px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%; padding: 12px 14px;
  border: 2px solid var(--border-d);
  border-radius: var(--r-md); font-size: .95rem; color: var(--text);
  background: var(--surface); min-height: 48px;
  transition: border-color var(--trans), box-shadow var(--trans);
  -webkit-appearance: none; appearance: none;
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-control::placeholder { color: var(--text-xs); }
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-valid   { border-color: var(--success); }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 40px;
}
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint  { font-size: .8rem; color: var(--text-xs); margin-top: 4px; }
.form-error { font-size: .82rem; color: var(--danger); margin-top: 4px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
/* Mobil: form satırları tek kolona insin */
@media(max-width: 500px) {
  .form-row   { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
}

/* ===== TABLO ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th {
  padding: 11px 14px; background: var(--bg);
  color: var(--text-sm); font-weight: 700;
  text-align: left; border-bottom: 2px solid var(--border-d);
  white-space: nowrap; font-size: .8rem; text-transform: uppercase;
  letter-spacing: .04em;
}
.table td {
  padding: 13px 14px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg); }

/* ===== LİSTE KARTLARI (Mobil) ===== */
.list-card {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--sh-sm); padding: 15px 16px;
  margin-bottom: 10px; border: 1px solid var(--border);
  transition: box-shadow var(--trans), transform var(--trans);
}
.list-card:hover { box-shadow: var(--sh-md); transform: translateY(-1px); }
.list-card:active { transform: scale(.99); }
.list-card-top {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 8px;
}
.list-card-title { font-weight: 700; font-size: .97rem; color: var(--text); }
.list-card-meta  { font-size: .8rem; color: var(--text-sm); margin-top: 2px; }
.list-card-row   {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-top: 6px; padding-top: 8px;
  border-top: 1px solid var(--border);
}
.list-card-item  { font-size: .8rem; color: var(--text-sm); display: flex; align-items: center; gap: 4px; }

/* ===== BELGE NUMARASI ===== */
.doc-no {
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: .82rem; font-weight: 700;
  color: var(--primary); letter-spacing: -.3px;
}

/* ===== ROZETLER ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: .72rem; font-weight: 700; white-space: nowrap;
}
.badge-gray    { background: #f1f5f9; color: #475569; }
.badge-blue    { background: #dbeafe; color: #1d4ed8; }
.badge-green   { background: #dcfce7; color: #16a34a; }
.badge-yellow  { background: #fef9c3; color: #854d0e; }
.badge-orange  { background: #ffedd5; color: #c2410c; }
.badge-red     { background: #fee2e2; color: #dc2626; }
.badge-teal    { background: #ccfbf1; color: #0f766e; }
.badge-purple  { background: #ede9fe; color: #6d28d9; }

/* ===== UYARILAR ===== */
.alert {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 16px; border-radius: var(--r-md);
  margin-bottom: 14px; border-left: 4px solid;
  font-size: .9rem;
}
.alert-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.alert-close {
  background: none; border: none; cursor: pointer; padding: 0 0 0 10px;
  font-size: .95rem; line-height: 1; opacity: .55; flex-shrink: 0;
  color: inherit; transition: opacity .12s;
}
.alert-close:hover { opacity: 1; }
.alert-success { background: var(--success-l); border-color: var(--success); color: #14532d; }
.alert-error,
.alert-danger  { background: var(--danger-l);  border-color: var(--danger);  color: #7f1d1d; }
.alert-warning { background: var(--warning-l); border-color: var(--warning); color: #78350f; }
.alert-info    { background: var(--info-l);    border-color: var(--info);    color: #0c4a6e; }

/* ===== STOK DURUM ===== */
.stock-ok       { color: var(--success); font-weight: 700; }
.stock-low      { color: var(--warning); font-weight: 700; }
.stock-critical { color: var(--danger);  font-weight: 700; }
.stock-empty    { color: var(--text-xs); font-weight: 700; }
.diff-ok     { color: var(--success); font-weight: 600; }
.diff-short  { color: var(--danger);  font-weight: 600; }
.diff-excess { color: var(--warning); font-weight: 600; }

/* ===== FARK KUTUSU ===== */
.diff-box {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 13px; border-radius: var(--r-sm);
  font-size: .88rem; font-weight: 700; margin-top: 6px;
}
.diff-box.ok     { background: var(--success-l); color: var(--success); }
.diff-box.short  { background: var(--danger-l);  color: var(--danger);  }
.diff-box.excess { background: var(--warning-l); color: var(--warning); }

/* ===== MAL KABUL ÜRÜN SATIRI ===== */
.product-row {
  background: var(--surface); border-radius: var(--r-lg);
  border: 2px solid var(--border-d); padding: 16px;
  margin-bottom: 12px; transition: border-color var(--trans);
}
.product-row.has-diff   { border-color: var(--danger); }
.product-row.has-excess { border-color: var(--warning); }
.product-row.is-ok      { border-color: var(--success); }
.product-row-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; margin-bottom: 14px;
}
.product-code { font-size: .75rem; color: var(--text-xs); font-weight: 600; }
.product-name { font-weight: 800; font-size: 1rem; color: var(--text); }
.btn-remove-row {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--danger-l); border: none;
  color: var(--danger); cursor: pointer; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.btn-remove-row:hover { background: var(--danger); color: #fff; }

/* ===== FİLTRE ACCORDION ===== */
.filter-wrap {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--sh-sm); margin-bottom: 14px;
  border: 1px solid var(--border); overflow: hidden;
}
.filter-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; cursor: pointer; user-select: none;
  border: none; background: none; width: 100%; text-align: left;
  font-family: inherit;
  transition: background var(--trans);
}
.filter-toggle:hover { background: var(--bg); }
.filter-toggle-left {
  display: flex; align-items: center; gap: 10px;
  font-size: .88rem; font-weight: 700; color: var(--text-sm);
}
.filter-toggle-left i { color: var(--primary); font-size: .9rem; }
.filter-active-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; border-radius: 10px;
  background: var(--primary); color: #fff;
  font-size: .68rem; font-weight: 800; padding: 0 5px;
}
.filter-toggle-right { display: flex; align-items: center; gap: 8px; }
.filter-toggle-arrow {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--bg); color: var(--text-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; transition: transform .2s, background .15s;
  flex-shrink: 0;
}
.filter-wrap.open .filter-toggle-arrow { transform: rotate(180deg); background: var(--primary-l); color: var(--primary); }
.filter-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height .28s cubic-bezier(.4,0,.2,1);
  border-top: 0px solid var(--border);
}
.filter-wrap.open .filter-body {
  max-height: 400px;
  border-top-width: 1px;
}
.filter-bar {
  padding: 14px 16px;
}
.filter-bar form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filter-bar .form-group { margin-bottom: 0; flex: 1 1 140px; min-width: 0; }
.filter-bar .form-control { min-height: 42px; padding: 9px 12px; }
/* Bağımsız filter-bar (wrap olmadan) geriye dönük uyumluluk */
.filter-bar:not(.filter-wrap .filter-bar) {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--sh-sm); margin-bottom: 14px;
  border: 1px solid var(--border);
}

/* ===== BARKOD ALANI ===== */
.barcode-area { position: relative; }
.barcode-input.bc-busy { opacity: .65; cursor: wait; background: #f8fafc;
  animation: bcBusyPulse .7s ease-in-out infinite; transition: opacity .15s; }
@keyframes bcBusyPulse { 0%,100% { opacity: .65; } 50% { opacity: .38; } }
.barcode-btn {
  position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
  background: var(--primary); color: #fff; border: none;
  border-radius: var(--r-sm); padding: 8px 12px; cursor: pointer;
  font-size: .9rem; height: calc(100% - 6px);
  display: flex; align-items: center; gap: 5px;
}
.barcode-btn:hover { background: var(--primary-d); }
.barcode-input { padding-right: 60px !important; }

/* ===== FOTOĞRAF YÜKLEYİCİ ===== */
.photo-upload-area {
  border: 2px dashed var(--border-d); border-radius: var(--r-lg);
  padding: 24px; text-align: center; cursor: pointer;
  transition: all var(--trans); background: var(--bg);
}
.photo-upload-area:hover { border-color: var(--primary); background: var(--primary-xl); }
.photo-upload-icon { font-size: 2.5rem; margin-bottom: 8px; color: var(--text-xs); }
.photo-upload-text { color: var(--text-sm); font-size: .9rem; font-weight: 500; }
.photo-preview-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 12px; }
.photo-preview-item {
  position: relative; aspect-ratio: 1;
  border-radius: var(--r-md); overflow: hidden;
}
.photo-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview-remove {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0,0,0,.6); color: #fff; border: none;
  border-radius: 50%; width: 22px; height: 22px;
  font-size: .75rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ===== BARKOD TARAYICI ===== */
#barcode-scanner-modal {
  display: none; position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,.9); flex-direction: column;
  align-items: center; justify-content: center;
}
#barcode-scanner-modal.open { display: flex; }
#barcode-video-container {
  width: 100%; max-width: 400px;
  border-radius: var(--r-xl); overflow: hidden; position: relative;
  border: 3px solid var(--primary);
}
#barcode-video { width: 100%; display: block; }
.scanner-line {
  position: absolute; left: 0; right: 0; top: 50%; height: 2px;
  background: var(--danger); box-shadow: 0 0 10px var(--danger);
  animation: scan 2s linear infinite;
}
@keyframes scan { 0%,100% { top: 20%; } 50% { top: 80%; } }
.scanner-controls { display: flex; gap: 12px; margin-top: 20px; }
.scanner-hint { color: rgba(255,255,255,.7); font-size: .85rem; margin-top: 12px; text-align: center; }

/* ===== ALT NAVİGASYON ===== */
.bottom-nav {
  display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0,0,0,.06);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8px 4px; color: var(--text-xs);
  text-decoration: none; gap: 3px;
  font-size: .65rem; font-weight: 600;
  transition: color var(--trans);
  min-height: var(--bottom-h);
  position: relative;
}
.bottom-nav-item .bn-icon { font-size: 1.3rem; transition: transform var(--trans); }
.bottom-nav-item.active { color: #C41428; }
.bottom-nav-item.active .bn-icon { transform: translateY(-2px); }
.bottom-nav-item.active::after {
  content: '';
  position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 32px; height: 3px;
  background: #C41428; border-radius: 3px 3px 0 0;
}
.bottom-nav-item:hover { color: var(--primary); text-decoration: none; }
.bn-badge {
  position: absolute; top: 6px;
  right: calc(50% - 18px);
  background: var(--danger); color: #fff;
  font-size: .6rem; font-weight: 800;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid var(--surface);
}

/* ===== MODALlar ===== */
.modal-backdrop {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(15,23,42,.6); backdrop-filter: blur(4px);
  align-items: flex-end; justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  width: 100%; max-width: 560px; max-height: 90vh;
  overflow-y: auto; padding: 24px;
  animation: slideUp .25s cubic-bezier(.4,0,.2,1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1.08rem; font-weight: 800; }
.modal-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-sm); cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--border); }
.modal-footer {
  display: flex; gap: 10px; margin-top: 24px;
  padding-top: 16px; border-top: 1px solid var(--border);
}

/* ===== SAYFALAMA ===== */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.page-btn {
  min-width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md); border: 1px solid var(--border-d);
  background: var(--surface); color: var(--text-sm); font-size: .88rem;
  cursor: pointer; font-weight: 600; text-decoration: none;
  transition: all var(--trans);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ===== GİRİŞ SAYFASI ===== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(160deg, #1a0509 0%, #7B0D1E 50%, #C41428 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--surface); border-radius: var(--r-2xl);
  padding: 36px 32px; width: 100%; max-width: 420px;
  box-shadow: var(--sh-xl);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-icon {
  width: 80px; height: 80px; border-radius: 20px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  box-shadow: 0 8px 24px rgba(196,20,40,.25);
  overflow: hidden;
}
.login-logo-icon img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.login-logo-icon .logo-fallback { font-size: 1.8rem; font-weight: 900; color: #C41428; letter-spacing: -1px; }
.login-logo h1 { font-size: 1.4rem; font-weight: 900; color: var(--text); }
.login-logo p  { font-size: .85rem; color: var(--text-sm); margin-top: 4px; }

/* ===== YÜKLEME ===== */
.spinner {
  display: inline-block; width: 22px; height: 22px;
  border: 3px solid var(--border-d);
  border-top-color: var(--primary);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(255,255,255,.85); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px;
}
.loading-overlay.active { display: flex; }

/* ===== DURUM ROZETLERI ===== */
/* statusBadge() helper uyumlu */
.badge-gray   { background: #f1f5f9; color: #475569; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: #dcfce7; color: #16a34a; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-teal   { background: #ccfbf1; color: #0f766e; }
.badge-purple { background: #ede9fe; color: #6d28d9; }

/* ===== ÇEVRİMDIŞI ===== */
#offline-banner {
  position: fixed; top: var(--navbar-h); left: 0; right: 0; z-index: 150;
  background: var(--danger); color: #fff;
  text-align: center; padding: 10px 16px;
  font-size: .85rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* ===== YARDIMCI ===== */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-sm     { font-size: .82rem; }
.text-xs     { font-size: .75rem; }
.text-muted  { color: var(--text-sm); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.text-warning{ color: var(--warning); }
.text-primary{ color: var(--primary); }
.fw-bold     { font-weight: 700; }
.fw-black    { font-weight: 900; }
.d-none      { display: none !important; }
.d-flex      { display: flex; }
.align-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top:4px; }  .mt-2 { margin-top:8px; }
.mt-3 { margin-top:12px; } .mt-4 { margin-top:16px; }
.mb-1 { margin-bottom:4px; }  .mb-2 { margin-bottom:8px; }
.mb-3 { margin-bottom:12px; } .mb-4 { margin-bottom:16px; }
.p-0  { padding: 0 !important; }

/* Stok çubuğu */
.stock-bar-wrap { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.stock-bar { height: 100%; border-radius: 3px; transition: width .4s; }
.stock-bar.sb-ok  { background: var(--success); }
.stock-bar.sb-low { background: var(--warning); }
.stock-bar.sb-crit{ background: var(--danger); }

/* ===== TABLET (640px+) ===== */
@media(min-width: 640px) {
  .quick-actions { grid-template-columns: repeat(3, 1fr); }
  .stat-grid     { grid-template-columns: repeat(3, 1fr); }
  .bottom-nav    { display: none; }
  .main-content  { padding: 20px; padding-bottom: 20px; }
}

/* ===== MASAÜSTÜ (1024px+) ===== */
@media(min-width: 1024px) {
  .quick-actions { grid-template-columns: repeat(4, 1fr); }
  .stat-grid     { grid-template-columns: repeat(4, 1fr); }
  .sidebar       { transform: translateX(0); }
  .app-layout    { padding-left: var(--sidebar-w); }
  .navbar        { left: var(--sidebar-w); }
  .btn-menu        { display: none !important; }
  .sidebar-overlay  { display: none !important; }
  .sidebar-close    { display: none !important; }
  .main-content     { padding: 28px; padding-bottom: 28px; }
  /* Masaüstünde hamburger + marka gizle (sidebar zaten gösteriyor) */
  #menuToggle       { display: none !important; }
  .navbar-brand     { display: none !important; }
  .topbar-title     { padding-left: 4px; }
}

/* ===== GENİŞ EKRAN (1280px+) ===== */
@media(min-width: 1280px) {
  .main-content { padding: 32px; padding-bottom: 32px; }
}

/* ===== ÇOK KÜÇÜK EKRAN (360px-) ===== */
@media(max-width: 360px) {
  /* Topbar dropdown yan taşmasın */
  .topbar-dropdown { min-width: calc(100vw - 24px); right: -8px; }
  /* Page başlığı daha küçük */
  .page-title { font-size: 1.05rem; }
  /* Butonlar daha küçük */
  .btn-lg  { padding: 12px 20px; font-size: .95rem; min-height: 46px; }
  .btn-xl  { padding: 14px 22px; font-size: 1rem;  min-height: 52px; }
  /* Kart başlığı overflow koruması */
  .card-header { flex-wrap: wrap; gap: 6px; }
}

/* ===== YAZDIRMA ===== */
@media print {
  .navbar, .sidebar, .bottom-nav,
  .filter-bar, .page-actions .btn-primary { display: none !important; }
  .app-layout { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ===== GERİYE DÖNÜK UYUMLULUK (eski app.css değişkenleri) ===== */
:root {
  --gray-50:    #f8fafc;
  --gray-100:   #f1f5f9;
  --gray-200:   #e2e8f0;
  --gray-300:   #cbd5e1;
  --gray-400:   #94a3b8;
  --gray-500:   #64748b;
  --gray-600:   #475569;
  --gray-700:   #334155;
  --gray-800:   #1e293b;
  --gray-900:   #0f172a;
  --white:      #ffffff;
  --radius:     12px;
  --radius-sm:  8px;
  --radius-lg:  16px;
  --shadow:     0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,.07);
  --shadow-lg:  0 10px 24px rgba(0,0,0,.09);
  --success-light: #dcfce7;
  --danger-light:  #fee2e2;
  --warning-light: #fef3c7;
  --info-light:    #e0f2fe;
  --primary-dark:  #A01020;
}

/* Eksik yardımcı sınıflar */
.btn-icon { padding: 10px 12px; }
.has-bottom-nav .main-content { padding-bottom: calc(var(--bottom-h) + 16px); }
.dash-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin-bottom: 16px; }
@media(min-width:640px) { .dash-grid { grid-template-columns: repeat(3,1fr); } }
@media(min-width:1024px) { .dash-grid { grid-template-columns: repeat(4,1fr); } }
/* Admin dashboard 2-col paneller — mobilde 1 sütun */
.admin-2col { display: grid; gap: 14px; margin-bottom: 14px; grid-template-columns: 1fr; }
@media(min-width: 700px) { .admin-2col { grid-template-columns: 1fr 1fr; } }

/* Stok kartı eski uyumluluk */
.summary-row { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-bottom: 16px; }
.summary-item {
  background: var(--surface); border-radius: var(--r-lg);
  padding: 13px 14px; box-shadow: var(--sh-sm); border: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
@media(min-width:640px) { .summary-row { grid-template-columns: repeat(3,1fr); } }
@media(min-width:1024px) { .summary-row { grid-template-columns: repeat(4,1fr); } }

/* Eski dash-card uyumluluk */
.dash-card {
  background: var(--surface); border-radius: var(--r-xl);
  padding: 20px 16px; box-shadow: var(--sh-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; text-decoration: none; color: var(--text);
  min-height: 110px; transition: transform .15s, box-shadow .15s;
  border: 2px solid transparent; cursor: pointer;
}
.dash-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); text-decoration: none; color: var(--text); }
.dash-card:active { transform: scale(.97); }
.dash-card-icon { font-size: 2.2rem; margin-bottom: 8px; }
.dash-card-label { font-size: .9rem; font-weight: 700; }
.dash-card-count { font-size: 1.4rem; font-weight: 900; margin-top: 2px; }

/* ===== FORM AKSİYON BUTON SATIRI ===== */
/* Tüm create/edit formlarının alt kısmındaki kaydet/iptal buton satırı */
.form-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.form-actions .btn { min-width: 0; }
/* Masaüstü: flex oranları korunur */
@media(min-width: 501px) {
  .form-actions .btn-flex-1 { flex: 1; }
  .form-actions .btn-flex-2 { flex: 2; }
}
/* Mobil: butonlar alt alta, tam genişlik */
@media(max-width: 500px) {
  .form-actions { flex-direction: column; }
  .form-actions .btn,
  .form-actions a.btn { width: 100% !important; flex: none !important; text-align: center; justify-content: center; }
}

/* ===== DETAY IZGARASI (profil, hurda show vb.) ===== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-bottom: 4px;
}
.detail-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.detail-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.detail-value {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
}
@media(max-width: 480px) {
  .detail-grid { grid-template-columns: 1fr; }
}

/* ===== BİLGİ IZGARASI (show sayfaları) ===== */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.info-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
/* Tablet: 3-col → 2-col */
@media(max-width: 640px) {
  .info-grid-3 { grid-template-columns: 1fr 1fr; }
}
/* Mobil: 2-col → 1-col */
@media(max-width: 400px) {
  .info-grid { grid-template-columns: 1fr; }
  /* info-grid-3 (miktar karşılaştırma): her zaman en az 2 kolon */
  .info-grid-3 { grid-template-columns: 1fr 1fr; }
}

/* ===== İKİ KOLONLU YÖNETİM IZGARASI ===== */
/* admin/units, admin/categories, vb. iki panel yan yana */
.admin-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media(max-width: 640px) {
  .admin-split-grid { grid-template-columns: 1fr; }
}

/* ===== FİLTRE BUTON GRUBU ===== */
/* filter-bar içindeki "Ara + Temizle" gibi buton çiftleri */
.filter-btn-group {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: flex-end;
  margin-bottom: 0;
}

/* ===== SAYFA AKSİYON BUTONLARI ===== */
/* page-header içindeki buton grubu — mobilde tam genişlik */
@media(max-width: 480px) {
  .page-actions { width: 100%; justify-content: flex-end; }
  .page-header  { align-items: flex-start; }
}

/* ===== CARD FOOTER AKSİYON ===== */
.card-footer { flex-wrap: wrap; }

/* ===== GENEL GENİŞLİK GUARD ===== */
/* Herhangi bir iç elementin taşmasını engelle */
.card > *, .card-body > *, .card-header > * { min-width: 0; }

/* ===== STOK SAYFASI ÖZEL STİLLER ===== */
.stock-search-wrap {
  background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--border); box-shadow: var(--sh-sm);
  margin-bottom: 14px; overflow: hidden;
}
.stock-search-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.stock-search-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: .95rem; font-family: inherit; color: var(--text);
}
.stock-search-input::placeholder { color: #94a3b8; }
.stock-chips {
  display: flex; gap: 8px; padding: 10px 16px; flex-wrap: wrap;
  border-bottom: 1px solid #f8fafc;
}
.stock-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 20px;
  font-size: .78rem; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: all .12s;
  background: var(--bg); color: var(--text-sm);
  border: 1.5px solid var(--border);
}
.stock-chip:hover { background: #e2e8f0; text-decoration: none; color: var(--text); }
.stock-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.stock-chip.chip-danger.active { background: var(--danger); border-color: var(--danger); }
.stock-chip.chip-gray.active { background: #475569; border-color: #475569; }
.stock-chip.chip-warehouse.active { background: #0284c7; border-color: #0284c7; color:#fff; }
.stock-chip-divider { display:inline-block; width:1px; height:24px; background:#e2e8f0; margin:0 2px; align-self:center; flex-shrink:0; }
/* View toggle buttons */
.view-toggle-btn {
  width: 32px; height: 32px; border-radius: 6px; border: none; cursor: pointer;
  background: transparent; color: #94a3b8; font-size: .88rem;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.view-toggle-btn.active { background: #fff; color: var(--primary); box-shadow: var(--sh-sm); }
.view-toggle-btn:hover:not(.active) { background: rgba(0,0,0,.06); color: var(--text); }
/* Stok kart iyileştirmesi */
.stock-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit; transition: background .1s;
}
.stock-card:last-child { border-bottom: none; }
.stock-card:hover { background: #fafbfc; text-decoration: none; color: inherit; }
.stock-card-icon {
  width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
  background: var(--primary-l); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; font-weight: 800; letter-spacing: -.5px;
}
.stock-card-icon.si-danger  { background: var(--danger-l);  color: var(--danger); }
.stock-card-icon.si-warning { background: var(--warning-l); color: var(--warning); }
.stock-card-icon.si-empty   { background: #f1f5f9; color: #94a3b8; }
.stock-card-body { flex: 1; min-width: 0; }
.stock-card-name { font-weight: 700; font-size: .95rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stock-card-meta { font-size: .78rem; color: #64748b; margin-top: 2px; }
.stock-card-qty { text-align: right; flex-shrink: 0; }
.stock-card-qty-num { font-size: 1.35rem; font-weight: 900; line-height: 1; }
.stock-card-qty-num.sq-normal  { color: var(--success); }
.stock-card-qty-num.sq-warning { color: var(--warning); }
.stock-card-qty-num.sq-danger  { color: var(--danger); }
.stock-card-qty-num.sq-empty   { color: #94a3b8; }
.stock-card-qty-unit { font-size: .75rem; color: #94a3b8; margin-top: 1px; }

/* ===== TOAST ANİMASYONU ===== */
@keyframes wmsToastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-14px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== MOBİL OVERFLOW & RESPONSIVE DÜZELTMELER ===== */
/* 1. Ana içerik kutusu genişliği */
.main-content { width: 100%; box-sizing: border-box; }

/* 2. Kart içerikleri taşmasın */
.card, .card-body { min-width: 0; word-break: break-word; }
.card-header { min-width: 0; }
.card-header > * { min-width: 0; }

/* 3. Stat card — çok uzun sayı/metin taşmasın */
.stat-card { min-width: 0; }
.stat-value { word-break: break-all; }

/* 4. Barkod alanı — dar ekranlarda alt alta geçsin */
.barcode-area { min-width: 0; flex-shrink: 1; }
@media(max-width: 400px) {
  .barcode-area { flex: 1 1 100%; }
}

/* 6. Sayfa başlığı — dar ekranda sarılsın */
.page-header { flex-wrap: wrap; gap: 10px; }
.page-title  { min-width: 0; flex-shrink: 1; word-break: break-word; }

/* 7. Tablo hücreleri — taşma koruması */
.table td, .table th { max-width: 250px; overflow: hidden; text-overflow: ellipsis; }
.table td:last-child, .table th:last-child { max-width: none; white-space: nowrap; } /* İşlem kolonları sarılmasın */
@media(max-width: 640px) {
  .table td, .table th { padding: 9px 10px; font-size: .82rem; }
}

/* 8. Barkod modal — küçük ekranda tam genişlik */
#bc-modal > div { max-width: 100% !important; }
@media(max-width: 480px) {
  #bc-modal { padding: 12px !important; }
}

/* 9. Admin 2-col içindeki flex satırlar taşmasın */
.admin-2col .card { min-width: 0; }

/* 10. Alert bandı tam genişlik */
.js-alert-top { width: 100%; box-sizing: border-box; }

/* 11. dash-grid mobil — en küçük ekranlarda tek kolon */
@media(max-width: 380px) {
  .dash-grid { grid-template-columns: 1fr; }
  .stat-grid  { grid-template-columns: 1fr 1fr; }
}

.dash-card.primary { border-color: var(--primary); background: var(--primary-l); }
.dash-card.success { border-color: var(--success); background: var(--success-light); }
.dash-card.warning { border-color: var(--warning); background: var(--warning-light); }
.dash-card.danger  { border-color: var(--danger);  background: var(--danger-light); }
.dash-card.info    { border-color: var(--info);    background: var(--info-light); }

/* ===== PO SİPARİŞ KABUL KARTI ===== */
.po-receipt-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid #f1f5f9;
  text-decoration: none; color: inherit; transition: background .12s; gap: 14px;
}
.po-receipt-card:last-child { border-bottom: none; }
.po-receipt-card:hover      { background: #fdf2f3; text-decoration: none; color: inherit; }
.po-receipt-card.po-delayed { border-left: 3px solid #dc2626; }
.po-receipt-left  { flex: 1; min-width: 0; }
.po-receipt-num   {
  font-weight: 800; font-size: .95rem; color: #1e293b; margin-bottom: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.po-receipt-meta  { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: .77rem; color: #64748b; }
.po-receipt-meta span { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.po-receipt-meta i    { color: #94a3b8; font-size: .78rem; }
.po-receipt-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* Status kolon: chip + ilerleme metni */
.po-status-col    { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.po-status-chip   {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 700; padding: 4px 10px;
  border-radius: 20px; white-space: nowrap; letter-spacing: .01em;
}
.po-status-chip i  { font-size: .6rem; }
.po-chip-open      { background: #dbeafe; color: #1d4ed8; }
.po-chip-partial   { background: #fef3c7; color: #92400e; }
.po-progress-txt   { font-size: .69rem; color: #94a3b8; white-space: nowrap; text-align: right; }

/* CTA butonu */
.po-cta-btn {
  display: flex; align-items: center; gap: 6px; background: var(--primary); color: #fff;
  padding: 10px 16px; border-radius: 9px; font-size: .84rem; font-weight: 700;
  white-space: nowrap; transition: background .15s; flex-shrink: 0;
}
.po-receipt-card:hover .po-cta-btn { background: var(--primary-d); }

/* Kısmi sipariş — sarı/turuncu varyant */
.po-cta-btn.po-cta-partial                  { background: #d97706; }
.po-receipt-card:hover .po-cta-btn.po-cta-partial { background: #b45309; }
.po-card-partial                            { border-left: 3px solid #d97706; }

/* Gecikme meta etiketi */
.po-meta-danger { color: #dc2626; font-weight: 700; }

/* Eski badge backward-compat (kullanılmıyor ama silinmedi) */
.po-remaining-badge {
  background: #fef3c7; color: #92400e; font-size: .72rem; font-weight: 700;
  padding: 3px 9px; border-radius: 20px; white-space: nowrap;
}

@media (max-width: 520px) {
  .po-receipt-card  { flex-wrap: wrap; padding: 13px 14px; gap: 10px; }
  .po-receipt-left  { flex: 1 1 100%; }
  .po-receipt-right { flex: 1 1 100%; justify-content: space-between; align-items: center; }
  .po-status-col    { align-items: flex-start; }
  .po-progress-txt  { text-align: left; }
  .po-cta-btn       { flex: 0 0 auto; padding: 10px 14px; font-size: .82rem; }
  .po-receipt-num   { font-size: .88rem; }
}

/* ===== PO / MANUEL CTA KARTI ===== */
.po-manual-cta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: #f8fafc; border: 1px dashed #cbd5e1;
  border-radius: 12px; margin-top: 10px; gap: 12px;
}
.po-manual-left { display: flex; align-items: center; gap: 12px; }
.po-manual-icon {
  width: 38px; height: 38px; border-radius: 10px; background: #e2e8f0; color: #64748b;
  display: flex; align-items: center; justify-content: center; font-size: .95rem; flex-shrink: 0;
}
.dash-card.secondary { border-color: var(--border-d); background: var(--bg); }

/* ===== PRINT / PDF ===== */
@media print {
  /* Gizle: navigasyon, butonlar, filtreler, alertler */
  .navbar, .sidebar, .sidebar-overlay, .bottom-nav,
  .no-print, .filter-wrap, .form-actions, .page-header .btn,
  .alert, #offline-banner, #wms-toast, #bc-modal,
  .nav-icon-btn, .topbar-drop-wrap { display: none !important; }

  /* Layout düzelt */
  body { background: #fff !important; font-size: 12px; color: #000; }
  .main-content { margin: 0 !important; padding: 0 !important; max-width: 100% !important; }
  .content-wrap { padding: 0 !important; padding-bottom: 0 !important; }

  /* Kartlar */
  .card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; margin-bottom: 12px; border-radius: 0 !important; }
  .card-header { background: #f5f5f5 !important; color: #000 !important; border-bottom: 1px solid #ccc; padding: 8px 12px; font-weight: 700; }
  .card-body { padding: 10px 12px !important; }

  /* Page header — sadece başlık göster, butonları gizle */
  .page-header { border: none !important; background: none !important; padding: 0 0 12px !important; box-shadow: none !important; }
  .page-header .btn, .page-header a.btn { display: none !important; }

  /* Tablolar */
  .table, .data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
  .table th, .table td, .data-table th, .data-table td { border: 1px solid #ccc !important; padding: 5px 8px !important; background: #fff !important; }
  .table th, .data-table th { background: #f0f0f0 !important; font-weight: 700; }
  tr[data-href] { cursor: default; }

  /* Badge'ler düz yazıya */
  .badge { border: 1px solid #ccc; padding: 2px 6px; border-radius: 4px; font-weight: 600; background: none !important; color: #333 !important; }

  /* Detail grid */
  .detail-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .detail-label { font-weight: 700; font-size: .75rem; }

  /* Print footer göster */
  .print-footer { display: block !important; margin-top: 20px; padding-top: 10px; border-top: 1px solid #ccc; font-size: 10px; color: #666; text-align: center; }

  /* Sayfa ayarları */
  @page { margin: 15mm 12mm; size: A4 portrait; }
  h1,h2,h3 { break-after: avoid; }
  table { break-inside: auto; }
  tr { break-inside: avoid; }
}
