:root {
    --primary: #b91c1c;
    --primary-light: #dc2626;
    --accent: #ed8936;
    --success: #38a169;
    --warning: #dd6b20;
    --danger: #e53e3e;
    --bg: #f7fafc;
    --card-bg: #ffffff;
    --text: #2d3748;
    --text-muted: #718096;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --radius: 12px;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ========== LOGIN ========== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 50%, #3182ce 100%);
    padding: 20px;
}
.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo h1 { font-size: 1.75rem; font-weight: 700; color: var(--primary); }
.login-logo p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.25rem; }
.login-card .form-control { border-radius: 10px; padding: 0.75rem 1rem; border: 1.5px solid var(--border); }
.login-card .form-control:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.15); }
.btn-login { background: var(--primary); border: none; border-radius: 10px; padding: 0.75rem; font-weight: 600; }
.btn-login:hover { background: var(--primary-light); transform: translateY(-1px); }

/* ========== LAYOUT ========== */
.app-wrapper { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px;
    background: var(--primary);
    color: white;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
}
.sidebar-brand { padding: 1.5rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-brand h4 { font-weight: 700; font-size: 1.25rem; margin: 0; }
.sidebar-brand small { opacity: 0.7; font-size: 0.75rem; }
.sidebar-nav { flex: 1; padding: 1rem 0; }
.sidebar-nav .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
}
.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--accent);
}
.sidebar-nav .nav-link i { width: 20px; text-align: center; }
.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.85rem; }
.main-content { flex: 1; display: flex; flex-direction: column; overflow-x: hidden; }
.topbar {
    background: white;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}
.topbar-title { font-weight: 600; font-size: 1.15rem; }
.content-area { padding: 1.5rem; flex: 1; }

/* ========== CARDS ========== */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    height: 100%;
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card .stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
}
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.stat-card .stat-label { color: var(--text-muted); font-size: 0.85rem; }

/* ========== TABLE ========== */
.stock-table-card, .content-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}
.stock-table-card .card-header,
.content-card .card-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.table-stock { margin: 0; }
.table-stock thead th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1rem;
    white-space: nowrap;
}
.table-stock tbody td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}
.table-stock tbody tr:hover { background: #f8fafc; }

/* Stok renkleri */
.badge-stok {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.35rem 0.75rem; border-radius: 999px;
    font-weight: 600; font-size: 0.8rem;
}
.badge-stok.yesil { background: #c6f6d5; color: #276749; }
.badge-stok.turuncu { background: #feebc8; color: #c05621; }
.badge-stok.kirmizi { background: #fed7d7; color: #c53030; }
.badge-stok .dot { width: 8px; height: 8px; border-radius: 50%; }
.badge-stok.yesil .dot { background: #38a169; }
.badge-stok.turuncu .dot { background: #dd6b20; }
.badge-stok.kirmizi .dot { background: #e53e3e; }

/* Butonlar */
.btn-sm-icon {
    width: 34px; height: 34px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px;
}
.btn-primary-custom {
    background: var(--primary); border-color: var(--primary);
    border-radius: 8px; font-weight: 500; color: white;
}
.btn-primary-custom:hover { background: var(--primary-light); border-color: var(--primary-light); color: white; }

/* ========== FOTOĞRAF + LIGHTBOX ========== */
.foto-thumb {
    width: 48px; height: 48px;
    border-radius: 10px;
    object-fit: cover;
    background: #edf2f7;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.foto-thumb:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.foto-thumb-lg {
    width: 120px; height: 120px;
    border-radius: 12px;
    object-fit: cover;
    background: #edf2f7;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.foto-thumb-lg:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}
.foto-placeholder {
    width: 48px; height: 48px;
    border-radius: 10px;
    background: #edf2f7;
    display: flex; align-items: center; justify-content: center;
    color: #a0aec0; font-size: 1.25rem;
    border: 1px solid var(--border);
}
.foto-placeholder-lg {
    width: 120px; height: 120px;
    border-radius: 12px;
    background: #edf2f7;
    display: flex; align-items: center; justify-content: center;
    color: #a0aec0; font-size: 2.5rem;
    border: 1px solid var(--border);
}
.foto-gallery {
    display: flex; flex-wrap: wrap; gap: 0.75rem;
}
.foto-gallery-item {
    position: relative;
    width: 100px; height: 100px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #edf2f7;
}
.foto-gallery-item img {
    width: 100%; height: 100%; object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}
.foto-gallery-item img:hover { transform: scale(1.06); }
.foto-gallery-item .foto-remove {
    position: absolute; top: 4px; right: 4px;
    width: 24px; height: 24px; border-radius: 50%;
    background: rgba(0,0,0,0.6); color: white;
    border: none; font-size: 0.7rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 2;
}

/* ========== DETAY ========== */
.detail-header {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}
.detail-header .malzeme-adi { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.stok-buyuk { font-size: 2.5rem; font-weight: 800; line-height: 1; }
.hareket-form-card, .hareket-list-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}
.hareket-form-card .card-header,
.hareket-list-card .card-header {
    background: #f8fafc;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

/* Not kartı */
.not-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 1.25rem;
    transition: transform 0.2s;
    height: 100%;
    text-decoration: none;
    color: inherit;
    display: block;
}
.not-card:hover { transform: translateY(-2px); color: inherit; }
.not-card .not-tarih { font-size: 0.8rem; color: var(--text-muted); }
.not-card .not-baslik { font-weight: 600; margin: 0.5rem 0; color: var(--text); }
.not-card .not-icerik-OLD {
    font-size: 0.9rem; color: var(--text-muted);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.not-card .not-foto {
    width: 40px; height: 40px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid var(--border);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 991.98px) {
    .sidebar { position: fixed; left: -260px; top: 0; bottom: 0; z-index: 1040; }
    .sidebar.show { left: 0; }
    .sidebar-overlay {
        display: none; position: fixed; inset: 0;
        background: rgba(0,0,0,0.4); z-index: 1035;
    }
    .sidebar-overlay.show { display: block; }
}

.text-muted-custom { color: var(--text-muted) !important; }
.fw-600 { font-weight: 600; }
.search-box { position: relative; }
.search-box input {
    padding-left: 2.5rem; border-radius: 10px; border: 1.5px solid var(--border);
}
.search-box i {
    position: absolute; left: 0.9rem; top: 50%;
    transform: translateY(-50%); color: var(--text-muted);
}
.user-avatar-placeholder {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex; align-items: center; justify-content: center;
}

/* Stok hareket tipi butonları */
.hareket-tip-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hareket-tip-group .btn {
  flex: 1 1 calc(33.33% - 0.5rem);
  min-width: 90px;
  border-radius: 10px;
  padding: 0.65rem 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
}
.hareket-tip-group input { display: none; }
.hareket-tip-group label { cursor: pointer; margin: 0; }
.hareket-tip-group input:checked + label.btn-giris { background: #38a169; color: #fff; border-color: #38a169; }
.hareket-tip-group input:checked + label.btn-cikis { background: #e53e3e; color: #fff; border-color: #e53e3e; }
.hareket-tip-group input:checked + label.btn-iade { background: #dd6b20; color: #fff; border-color: #dd6b20; }
.hareket-tip-group label.btn-iade { border-color: #dd6b20; color: #c05621; background: #fffaf0; }

/* Hesaplayıcı sonuç */
.hesap-sonuc-sayi { font-size: 2rem; font-weight: 700; color: #fff; line-height: 1.2; }
.hesap-sonuc-label { color: rgba(255,255,255,.7); font-size: .9rem; }

/* Notlar */
.not-item { border-bottom: 1px solid #edf2f7; padding: 0.75rem 0; }
.not-item:last-child { border-bottom: none; }
.not-baslik { font-weight: 600; font-size: 0.9rem; color: #1a202c; }
.not-tarih { font-size: 0.75rem; color: #a0aec0; }
.not-icerik {
  font-size: 0.875rem;
  color: #4a5568;
  margin: 0.5rem 0 0;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.not-foto-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.not-foto-row img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid #e2e8f0; }
.btn-not-sil {
  width: 28px; height: 28px; border: none; border-radius: 8px;
  background: #fff5f5; color: #e53e3e; display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex-shrink: 0; transition: all .15s;
}
.btn-not-sil:hover { background: #e53e3e; color: #fff; }

/* Güzel file upload */
.file-upload-pretty {
  border: 2px dashed #cbd5e0; border-radius: 12px; padding: 1.25rem;
  text-align: center; background: #f7fafc; cursor: pointer; transition: all .2s;
  position: relative;
}
.file-upload-pretty:hover { border-color: #3182ce; background: #ebf8ff; }
.file-upload-pretty input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.file-upload-pretty .fu-icon { font-size: 1.75rem; color: #a0aec0; }
.file-upload-pretty .fu-text { font-size: 0.85rem; color: #718096; margin-top: 0.35rem; }

/* Tarih filtre bar */
.filtre-bar {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  background: #f7fafc; border-radius: 10px; padding: 0.6rem 0.75rem;
}
.filtre-bar .form-control { border-radius: 8px; font-size: 0.85rem; }

/* Foto sil tek tık */
.btn-foto-sil { z-index: 2; opacity: 0.9; border-radius: 50%; width: 26px; height: 26px; padding: 0 !important; }

/* ========== FİLTRE / ARAMA BAR ========== */
.filter-bar {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.filter-bar .btn-check:checked + .btn-outline-danger {
  background: #fed7d7; color: #c53030; border-color: #feb2b2;
}
.filter-bar .btn-check:checked + .btn-outline-warning {
  background: #feebc8; color: #c05621; border-color: #fbd38d;
}
.filter-bar .btn-check:checked + .btn-outline-success {
  background: #c6f6d5; color: #276749; border-color: #9ae6b4;
}
.filter-bar .btn-check:checked + .btn-outline-secondary {
  background: #edf2f7; color: #2d3748; border-color: #cbd5e0;
}
.filtre-durum .btn { font-size: 0.8rem; padding: 0.3rem 0.65rem; }

/* Tıklanabilir satır */
.table-stock tbody tr.row-clickable { cursor: pointer; transition: background 0.12s; }
.table-stock tbody tr.row-clickable:hover { background: #ebf8ff !important; }
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--primary); }

/* File upload zone */
.file-upload-zone {
  border: 2px dashed #cbd5e0;
  border-radius: 12px;
  padding: 1.5rem 1rem;
  text-align: center;
  background: #f7fafc;
  cursor: pointer;
  transition: all 0.2s;
}
.file-upload-zone:hover {
  border-color: #3182ce;
  background: #ebf8ff;
}

/* Log pagination */
#logPager .pagination .page-link {
  border-radius: 6px;
  margin: 0 2px;
  min-width: 32px;
  text-align: center;
  color: var(--primary);
}
#logPager .pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* GLightbox açıklama */
.glightbox-clean .gslide-title,
.gslide-title {
  font-size: 1rem !important;
  font-weight: 600 !important;
  color: #fff !important;
  text-align: center;
  padding: 0.5rem 1rem;
}
.gslide-description {
  color: rgba(255,255,255,0.85) !important;
  font-size: 0.9rem !important;
  text-align: center;
}
.gslide-desc {
  background: rgba(0,0,0,0.55) !important;
  padding: 0.75rem 1.25rem !important;
  border-radius: 0 0 8px 8px;
}

/* Stok satır renkleri (tablo) */
.table-stock tbody tr.row-kritik { background: #fff5f5; }
.table-stock tbody tr.row-uyari { background: #fffaf0; }
.table-stock tbody tr.row-yeterli { background: #f0fff4; }

/* Fotoğraf sürükle-bırak */
.foto-sortable { min-height: 40px; }
.foto-gallery-item[draggable="true"] { cursor: grab; }
.foto-gallery-item.dragging { opacity: 0.45; outline: 2px dashed var(--primary); }
.foto-gallery-item.drag-over { outline: 2px solid var(--accent); transform: scale(1.03); }
.foto-drag-handle {
  position: absolute; left: 4px; bottom: 4px; z-index: 3;
  width: 22px; height: 22px; border-radius: 6px;
  background: rgba(0,0,0,.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; pointer-events: none;
}

/* GLightbox açıklama — daha şık */
.glightbox-clean .gslide-description {
  background: linear-gradient(180deg, transparent, rgba(15,23,42,.92)) !important;
  padding: 1.25rem 1.5rem !important;
  border-radius: 0 0 12px 12px;
}
.glightbox-clean .gslide-title,
.glightbox-clean .gslide-desc {
  color: #f8fafc !important;
  font-family: 'Segoe UI', system-ui, sans-serif !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.glightbox-clean .gslide-title {
  font-weight: 600 !important;
  font-size: 1rem !important;
  margin-bottom: 0.25rem !important;
}
.glightbox-clean .gslide-desc {
  font-size: 0.875rem !important;
  opacity: 0.9;
}
.goverlay { background: rgba(15, 23, 42, 0.85) !important; }

/* Sidebar logo (orijinal 1000x400 → yatay logo) */
.sidebar-brand { padding: 1.25rem 1rem; text-align: center; }
.sidebar-logo {
  max-width: 100%;
  width: 180px;
  height: auto;
  max-height: 64px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.sidebar-brand-sub {
  color: rgba(255,255,255,0.65);
  font-size: 0.7rem;
  margin-top: 0.35rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Profil avatar */
.user-avatar-wrap { flex-shrink: 0; }
.user-avatar-img {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; border: 2px solid rgba(255,255,255,0.35);
}

/* Login — logo kırmızısına uyumlu */
.login-wrapper {
  background: #b91c1c !important;
}
.login-logo-img {
  max-width: 280px;
  width: 100%;
  height: auto;
  max-height: 110px;
  object-fit: contain;
  margin: 0 auto 0.5rem;
  display: block;
}
.login-sub {
  color: #718096;
  font-size: 0.9rem;
  margin: 0.25rem 0 0;
}
.btn-login {
  background: #c53030 !important;
  border: none !important;
  border-radius: 10px;
  padding: 0.75rem;
  font-weight: 600;
}
.btn-login:hover { background: #9b2c2c !important; }


/* Soft kırmızı tema uyumu */
.sidebar { background: #9f1239 !important; }
.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  background: rgba(255,255,255,0.12) !important;
  border-left-color: #fecaca !important;
}
.btn-primary-custom { background: #b91c1c !important; border-color: #b91c1c !important; }
.btn-primary-custom:hover { background: #9f1239 !important; border-color: #9f1239 !important; }
.stat-card .stat-icon.bg-primary { background: rgba(185,28,28,.12) !important; }
.text-primary { color: #b91c1c !important; }
.badge.bg-primary { background: #b91c1c !important; }
.table-stock thead th { color: #9f1239; }
.pagination .page-item.active .page-link { background: #b91c1c; border-color: #b91c1c; }
.page-link { color: #b91c1c; }
.nav-tabs .nav-link.active { color: #b91c1c; border-color: #dee2e6 #dee2e6 #fff; }
.topbar .badge.bg-primary-subtle { background: #fee2e2 !important; color: #9f1239 !important; }


.hareket-tip-group label.btn-iade { border-color: #3182ce; color: #2b6cb0; }

.badge-iade { background: #dd6b20 !important; color: #fff !important; padding: 0.35em 0.65em; font-weight: 600; }


/* Yapılacaklar */
.gorev-item {
  border: 1px solid #edf2f7;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
  background: #fff;
  transition: box-shadow .15s;
}
.gorev-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.gorev-item.durum-beklemede { background: #fffaf0; border-color: #fbd38d; }
.gorev-item.durum-gecikti { background: #fff5f5; border-color: #feb2b2; }
.gorev-item.durum-yapildi { background: #f0fff4; border-color: #9ae6b4; }
.gorev-item.durum-iptal { background: #f7fafc; border-color: #e2e8f0; }
.gorev-item.yapildi .gorev-baslik,
.gorev-item.yapildi .gorev-aciklama {
  text-decoration: line-through;
  color: #718096 !important;
  opacity: 0.9;
}
.gorev-item.yapildi .gorev-meta { opacity: 0.8; }
.gorev-baslik { font-weight: 600; font-size: 0.9rem; color: #1a202c; }
.gorev-meta { font-size: 0.75rem; color: #a0aec0; margin-top: 0.2rem; }
.gorev-aciklama { font-size: 0.8rem; color: #4a5568; margin-top: 0.25rem; white-space: pre-wrap; word-break: break-word; }
.badge-beklemede { background: #feebc8; color: #c05621; }
.badge-yapildi { background: #c6f6d5; color: #276749; }
.badge-iptal { background: #e2e8f0; color: #4a5568; }
.badge-kalan { background: #bee3f8; color: #2b6cb0; }
.badge-gecikti { background: #fed7d7; color: #c53030; }
.editor-toolbar .btn { padding: 0.15rem 0.45rem; }
#modalGorevListe .modal-dialog { max-width: 960px; }
#tblGorevFull tbody tr.row-yapildi td { background: #f0fff4; }
#tblGorevFull tbody tr.row-beklemede td { background: #fffaf0; }
#tblGorevFull tbody tr.row-gecikti td { background: #fff5f5; }
#tblGorevFull tbody tr.row-yapildi .td-baslik,
#tblGorevFull tbody tr.row-yapildi .td-aciklama { text-decoration: line-through; color: #718096; }
