/* Primo Bootstrap Overrides */

:root {
  --primo-primary: #1a56db;
  --primo-primary-light: #e1effe;
  --primo-dark: #1e293b;
  --primo-bg: #f0f2f5;
  --primo-card-shadow: 0 1px 4px rgba(0,0,0,.08);
  --primo-success: #059669;
  --primo-danger: #dc2626;
}

body {
  background: var(--primo-bg);
  font-size: 14px;
}

/* Navbar */
.primo-navbar {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #334155 100%);
  padding: .5rem 0;
  box-shadow: 0 2px 16px rgba(0,0,0,.25);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.navbar-logo {
  height: 36px;
  border-radius: 6px;
  background: #fff;
  padding: 3px;
  transition: transform .2s;
}
.navbar-logo:hover { transform: scale(1.05); }
.primo-navbar .navbar-toggler {
  border: none;
  color: #fff;
  font-size: 1.4rem;
  padding: .4rem .6rem;
}
.nav-pills-group {
  display: flex;
  gap: 6px;
  padding: 3px;
  background: rgba(255,255,255,.06);
  border-radius: 10px;
  margin: 0 1rem;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: .5rem 1rem;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  transition: all .2s;
  white-space: nowrap;
}
.nav-btn:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
}
.nav-btn-active {
  background: var(--primo-primary) !important;
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(26,86,219,.4);
}
.navbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.navbar-user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: .35rem .75rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  color: rgba(255,255,255,.85);
  font-size: 13px;
  font-weight: 500;
}
.navbar-user-badge i { font-size: 14px; }
.navbar-cikis-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(220,38,38,.15);
  color: #fca5a5;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
}
.navbar-cikis-btn:hover {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
  box-shadow: 0 2px 8px rgba(220,38,38,.4);
}

/* Cards */
.card { border: none; box-shadow: var(--primo-card-shadow); border-radius: .75rem; }
.card-header { font-weight: 600; font-size: 15px; border-radius: .75rem .75rem 0 0 !important; }

/* Sipariş card gradient */
.siparis-card { border: none; overflow: hidden; box-shadow: 0 2px 12px rgba(26,86,219,.1); }
.siparis-card-header {
  background: linear-gradient(135deg, #1a56db 0%, #2563eb 40%, #3b82f6 100%);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: .75rem 1.25rem;
  border-radius: .75rem .75rem 0 0;
}
.siparis-card > .card-body {
  background: linear-gradient(180deg, #f0f5ff 0%, #ffffff 60%);
}

/* Tables */
.table { font-size: 13px; margin-bottom: 0; }
.table th { font-weight: 600; white-space: nowrap; background: #f8f9fa; position: sticky; top: 0; z-index: 2; }
.table td { vertical-align: middle; }
.table-hover tbody tr { transition: background .15s; }

/* Form inputs */
.form-control, .form-select { font-size: 14px; border-radius: .5rem; }
.form-control:focus, .form-select:focus { box-shadow: 0 0 0 .2rem rgba(26,86,219,.15); border-color: var(--primo-primary); }
.form-label { font-weight: 500; font-size: 13px; margin-bottom: .25rem; }

/* Floating labels */
.form-floating > .form-control { height: calc(3rem + 2px); }
.form-floating > label { padding: .75rem; color: #6c757d; }

/* Siparis kalem tablosu */
.kalem-tablosu thead th { background: var(--primo-dark); color: #fff; font-weight: 700; font-size: 13px; padding: .6rem .5rem; border: none; }
.kalem-tablosu .form-control { padding: .3rem .5rem; font-size: 13px; box-shadow: inset 0 1px 3px rgba(0,0,0,.12); }
.kalem-tablosu td { padding: .4rem .5rem; }

/* Toplamlar tablo */
.toplamlar-tablo { margin-left: auto; font-size: 14px; border-collapse: separate; border-spacing: 0 4px; }
.toplamlar-tablo td { padding: .25rem 0; }
.genel-toplam-satir td { font-size: 20px; font-weight: 700; color: var(--primo-dark); border-top: 2px solid var(--primo-dark); padding-top: .5rem; }

.stok-bilgi {
  margin-top: 3px;
  font-size: 12px;
  color: #6c757d;
  line-height: 1.3;
}
.stok-bilgi small { color: #adb5bd; margin-left: 4px; }

/* Toplamlar sticky */
.toplamlar-sticky {
  position: sticky;
  bottom: 0;
  background: #fff;
  z-index: 3;
  border-top: 2px solid #e2e8f0;
  padding: 1rem 0;
}

/* Cari arama dropdown */
.arama-sarma { position: relative; }
.arama-sonuc {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 .5rem .5rem;
  max-height: 220px;
  overflow-y: auto;
  z-index: 1060;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.arama-sonuc-oge {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
  transition: background .15s;
}
.arama-sonuc-oge:hover { background: var(--primo-primary-light); }
.arama-sonuc-oge .kod { font-weight: 600; color: #212529; }
.arama-sonuc-oge .ad { color: #6c757d; margin-left: 8px; }

/* Stok secim modal */
.stok-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5);
  z-index: 1070;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  backdrop-filter: blur(4px);
}
.stok-modal-icerik {
  background: #fff;
  width: 100%;
  max-width: 640px;
  border-radius: .75rem;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.stok-modal-ust {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #dee2e6;
}
.stok-modal-ust h3 { font-size: 16px; margin: 0; font-weight: 600; }
.stok-modal-arama {
  padding: .75rem 1.25rem;
  border-bottom: 1px solid #dee2e6;
}
.stok-modal-arama input {
  width: 100%;
  padding: .5rem .75rem;
  border: 2px solid var(--primo-primary);
  border-radius: .5rem;
  font-size: 15px;
  outline: none;
}
.stok-modal-arama input:focus { box-shadow: 0 0 0 .2rem rgba(26,86,219,.2); }
.stok-modal-liste {
  overflow-y: auto;
  flex: 1;
  min-height: 200px;
}
.stok-modal-satir {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 1.25rem;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background .15s;
}
.stok-modal-satir:hover { background: var(--primo-primary-light); }
.stok-modal-satir strong { min-width: 90px; font-size: 13px; color: #212529; }
.stok-modal-satir span { flex: 1; font-size: 13px; color: #495057; }
.stok-modal-satir small { color: #adb5bd; font-size: 12px; }
.stok-modal-satir em {
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  min-width: 70px;
  text-align: right;
}
.stok-modal-satir em.bakiye-var { color: var(--primo-success); }
.stok-modal-satir em.bakiye-yok { color: var(--primo-danger); }

/* Ekstre dokuman modal - fullscreen-md */
.ekstre-dokuman {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5);
  z-index: 1070;
  display: flex;
  align-items: stretch;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.ekstre-kagit {
  background: #fff;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  overflow-y: auto;
  position: relative;
}
.ekstre-kagit h2 { font-size: 18px; margin-bottom: 4px; }
.ekstre-kagit .ekstre-alt-baslik { color: #6c757d; font-size: 13px; margin-bottom: 1rem; }
.ekstre-kagit .table { box-shadow: none; }
.ekstre-kagit th { font-size: 12px; }
.ekstre-kagit td { font-size: 12px; padding: .4rem .5rem; }
.ekstre-ust-bar {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.ekstre-ozet {
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 2px solid #212529;
  font-weight: 600;
  font-size: 14px;
}

/* Toast container */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1090;
}

/* Summary cards */
.ozet-kart {
  border-radius: .75rem;
  padding: 1rem 1.25rem;
  text-align: center;
  transition: transform .2s;
}
.ozet-kart:hover { transform: translateY(-2px); }
.ozet-kart .ozet-deger { font-size: 1.5rem; font-weight: 700; }
.ozet-kart .ozet-etiket { font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; opacity: .8; }

/* Siparis accordion */
.siparis-satir { cursor: pointer; transition: background .15s; }
.siparis-satir:hover { background: var(--primo-primary-light) !important; }
.siparis-detay { display: none; background: #f8fafc; }
.siparis-detay.acik { display: table-row; }
.siparis-detay td { padding: 1rem 1.25rem !important; }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: .375rem;
  height: 1rem;
  margin-bottom: .5rem;
}
.skeleton-row { height: 2.5rem; margin-bottom: .25rem; }
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Login page */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e293b 100%);
}
.login-card {
  width: 100%;
  max-width: 400px;
  border-radius: 1rem;
  overflow: hidden;
}
.login-header {
  background: linear-gradient(135deg, var(--primo-primary) 0%, #1e40af 100%);
  color: #fff;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
}
.login-header .logo-icon { font-size: 3rem; margin-bottom: .5rem; }
.login-header h4 { margin: 0; font-weight: 700; }
.login-header p { margin: .25rem 0 0; opacity: .8; font-size: .875rem; }

/* Progress bar for stok */
.stok-progress {
  height: 6px;
  border-radius: 3px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 4px;
}
.stok-progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width .3s;
}

/* Print */
@media print {
  body > *:not(.ekstre-dokuman) { display: none !important; }
  .ekstre-dokuman { position: static; background: none; padding: 0; backdrop-filter: none; }
  .ekstre-kagit { box-shadow: none; padding: 20px; max-width: 100%; border-radius: 0; }
  .ekstre-ust-bar { display: none !important; }
}

/* Desktop ekstre */
@media (min-width: 768px) {
  .ekstre-kagit { max-width: 900px; margin: 2rem auto; border-radius: .75rem; height: auto; max-height: calc(100vh - 4rem); }
  .mobil-gizle-inline { display: none !important; }
}

/* Mobile responsive */
@media (max-width: 767.98px) {
  .mobil-gizle { display: none !important; }
  .mobil-gizle-inline { display: inline !important; }

  .ekstre-kagit { padding: 1rem; border-radius: 0; }
  .ekstre-ozet { flex-direction: column; gap: 4px; }
  .stok-modal { padding: 12px 6px; }
  .stok-modal-icerik { max-height: 90vh; }
  .kalem-tablosu .form-control { min-width: 60px; }
  .ozet-kart .ozet-deger { font-size: 1.2rem; }
  .nav-pills-group {
    flex-direction: column;
    margin: .5rem 0;
    gap: 2px;
    background: rgba(255,255,255,.04);
    border-radius: 8px;
    padding: 4px;
  }
  .nav-btn { padding: .6rem 1rem; border-radius: 6px; }
  .navbar-user {
    padding: .5rem 0;
    border-top: 1px solid rgba(255,255,255,.08);
    margin-top: .25rem;
  }
}
