
/* --- Suggestions (datalist yerine) --- */
.stock-suggestions{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 6px;
  z-index: 9999;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.stock-suggestion-item{
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: #e2e8f0;
}
.stock-suggestion-item + .stock-suggestion-item{
  margin-top: 6px;
}
.stock-suggestion-item:hover{
  background: rgba(59, 130, 246, 0.18);
}
:root {
    --bg-body: #0f172a;
    /* Very dark blue/slate */
    --bg-card: #1e293b;
    /* Slightly lighter slate */
    --bg-card-hover: #334155;
    /* Lighter for hovers */
    --bg-table-head: #020617;
    /* Almost black for headers */
    --bg-input: #0f172a;

    --text-main: #ffffff;
    /* Pure White */
    --text-muted: #cbd5e1;
    /* Lighter Grey (Slate 300) */
    /* Muted blue-grey */

    --accent: #3b82f6;
    /* Blue */
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;

    --border-color: #334155;
    /* Visible border */
    --card-radius: 16px;
    --transition: all 0.2s ease-in-out;
}

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

/* Navbar */
.navbar {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.navbar-brand {
    font-weight: 800;
    color: var(--text-main) !important;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
}

.navbar-brand img {
    height: 48px;
    border-radius: 10px;
}

.nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.6rem 1.2rem !important;
    border-radius: 8px;
    margin: 0 2px;
}

.nav-link:hover,
.nav-link.active {
    color: #fff !important;
    background-color: rgba(59, 130, 246, 0.15);
    /* Accent faint background */
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    transition: var(--transition);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.hover-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--accent);
    background-color: #263345;
    /* Slightly lighter on hover */
}

/* Custom Table Styles - Modern & Flat */
.custom-table-container {
    border-radius: var(--card-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--text-main);
    background-color: var(--bg-card);
}

.custom-table thead th {
    background-color: var(--bg-table-head);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.custom-table tbody td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.95rem;
    vertical-align: middle;
}

.custom-table tbody tr:last-child td {
    border-bottom: none;
}

.custom-table tbody tr {
    transition: background-color 0.2s;
}

.custom-table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
    /* Very slight blue tint on hover */
}

/* Typography & Badges */
.text-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-soft {
    padding: 0.35em 0.8em;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Timeline/Movements Styles */
.timeline-card {
    background-color: #27354d !important;
    /* Lighter than base card */
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.timeline-date-label {
    min-width: 60px;
    text-align: center;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Form Elements */
.form-control,
.form-select {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-input);
    color: var(--text-main);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.form-control::placeholder {
    color: #ffffff !important;
    opacity: 1 !important;
}

.form-control::-webkit-input-placeholder {
    color: #ffffff !important;
    opacity: 1 !important;
}

.form-control::-moz-placeholder {
    color: #ffffff !important;
    opacity: 1 !important;
}

.form-control:-ms-input-placeholder {
    color: #ffffff !important;
    opacity: 1 !important;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* --- Fixes: visibility & tables (auto-added) --- */
body, .card, .table, .form-label, label, .form-check-label, .navbar, .nav-link {
  color: #e5e7eb;
}

.text-secondary, .text-muted {
  color: #a3a3a3 !important;
}

input::placeholder, textarea::placeholder {
  color: #94a3b8 !important;
  opacity: 1;
}

.table td, .table th {
  color: #e5e7eb !important;
}

.table-dark {
  --bs-table-color: #e5e7eb;
}

.form-check-input {
  cursor: pointer;
}

/* Users page small UI */
.users-actions .btn,
.users-actions .form-control-sm,
.users-actions .form-select-sm{
  border-radius: 10px;
}

.users-actions form{
  margin: 0;
}


/* Sayfa geçişlerinde titremeyi önle (scrollbar sabit) */
body{ overflow-y: scroll; }

/* ---------------- Mobile responsive tweaks ---------------- */
@media (max-width: 576px){
  /* Navbar küçült */
  .navbar{ padding: .6rem 0; }
  .navbar-brand{ font-size: 1.15rem; gap: 10px; }
  .navbar-brand img{ height: 38px; }
  .nav-link{ padding: .45rem .75rem !important; font-size: .9rem; }

  /* Genel kart iç boşluk */
  .card-body{ padding: 1rem !important; }

  /* Stock list (products) - tablo taşmasın */
  .custom-table-container{ overflow-x: auto; }
  .custom-table thead th{ padding: .85rem 1rem; font-size: .7rem; }
  .custom-table tbody td{ padding: .85rem 1rem; font-size: .9rem; }

  /* Products üst butonlar mobile'da alt alta */
  .card-header .d-flex.gap-2{ flex-wrap: wrap; }
  .card-header .d-flex.gap-2 > *{ flex: 1 1 100%; }

  /* Movements (timeline) - telefonda çakışmayı önle ve yüksekliği azalt */
  .timeline-card .card-body{ padding: .85rem !important; }
  .timeline-card .card-body > .d-flex{ flex-wrap: wrap !important; gap: .35rem .75rem !important; align-items: flex-start !important; }
  .timeline-card .card-body > .d-flex > .d-flex{ flex: 1 1 100% !important; }
  .timeline-card .text-end{ flex: 1 1 100% !important; text-align: right !important; margin-top: 4px !important; }

  /* Sol ikon kutusu küçülsün */
  .timeline-card .rounded-3.p-3{ padding: .6rem !important; }
  .timeline-card i.fs-4{ font-size: 1.05rem !important; }

  /* Başlık ve etiketler küçülsün */
  .timeline-card h5{ font-size: .95rem !important; margin-bottom: 2px !important; }
  .timeline-card .badge{ font-size: .65rem !important; padding: .22rem .5rem !important; }

  /* Tarih-saat tek sütun ve küçük */
  .timeline-card .text-white.opacity-75.small{ font-size: .78rem !important; display: block !important; margin-top: 2px !important; }
}
/* Ürün arama kutusu disabled iken beyaz olmasın */
#productSearch:disabled{
  background-color: #1e293b !important;   /* inputların normal rengi */
  color: #94a3b8 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  cursor: not-allowed;
}

#productSearch:disabled::placeholder{
  color: #64748b !important;
  opacity: 1 !important;
}

/* Telefon ekranında stok listesinde yer aç: "Son İşlem" ve "Sil" sütunlarını gizle */
@media (max-width: 576px) {
  .custom-table th.col-last-action,
  .custom-table td.col-last-action,
  .custom-table th.col-delete,
  .custom-table td.col-delete {
    display: none !important;
  }
}


/* MOBİLDE TABLOYU DİKEY LİSTEYE ÇEVİR (yana kaydırma olmasın) */
@media (max-width: 768px) {
  .custom-table-container {
    overflow-x: hidden !important;
  }

  .custom-table thead {
    display: none !important;
  }

  .custom-table,
  .custom-table tbody,
  .custom-table tr,
  .custom-table td {
    display: block;
    width: 100%;
  }

  .custom-table tr {
    background: rgba(255,255,255,0.03);
    margin-bottom: 15px;
    border-radius: 12px;
    padding: 12px;
  }

  .custom-table td {
    padding: 6px 0 !important;
    border: none !important;
  }

  .custom-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 2px;
  }
}


/* MOBILE STOCK LIST COMPACT */
@media (max-width: 576px){
  /* keep only vertical scroll on mobile */
  body{ overflow-x:hidden; }

  .custom-table-container{ overflow-x: hidden !important; }
  .custom-table thead{ display:none !important; }
  .custom-table, .custom-table tbody, .custom-table tr, .custom-table td{ display:block; width:100%; }
  .custom-table tr{
    background: rgba(30,41,59,0.85);
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
  }
  .custom-table td{
    border: none !important;
    padding: 6px 0 !important;
    font-size: .92rem;
    display:flex;
    justify-content: space-between;
    align-items:center;
    gap: 10px;
  }
  .custom-table td::before{
    content: attr(data-label);
    font-weight: 600;
    color: #94a3b8;
    flex: 0 0 auto;
  }

  /* product cell compaction */
  .custom-table td .product-photo-thumb,
  .custom-table td .rounded-3{
    width: 34px !important;
    height: 34px !important;
  }
  .custom-table td .fw-bold{ font-size: 14px !important; }
  .custom-table td .fs-5{ font-size: 18px !important; }
}


/* MOBILE STOCK CARD LAYOUT */
@media (max-width:576px){
  .custom-table thead{display:none}
  .custom-table, .custom-table tbody, .custom-table tr, .custom-table td{display:block;width:100%}
  .custom-table tr{background:rgba(255,255,255,0.03);border-radius:14px;padding:12px;margin-bottom:12px}
  .mobile-stock-grid{display:grid;grid-template-columns:70px 1fr auto;gap:6px 10px;align-items:center}
  .mobile-photo{grid-row:1/span 2}
  .mobile-photo img{width:60px;height:60px;object-fit:cover;border-radius:12px}
  .mobile-name{font-size:13px;opacity:.85;max-width:52vw;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:break-word}
  .mobile-stockcode{font-weight:600;font-size:14px;max-width:52vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mobile-category{font-size:12px;opacity:.6;max-width:52vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mobile-qty{text-align:right;font-weight:700;font-size:16px}
  .mobile-unit{text-align:right;font-size:12px;opacity:.7}
  .desktop-only{display:none!important}
}


/* MOBILE STOCK LIST GRID (products table) */
@media (max-width: 576px){
  /* disable the generic "cardified table" labels for products table */
  #productsTable.custom-table td::before{ content: none !important; display:none !important; }

  #productsTable thead{ display:none !important; }
  #productsTable, #productsTable tbody{ display:block !important; width:100% !important; }
  #productsTable tr{
    display:grid !important;
    grid-template-columns: 72px 1fr auto;
    grid-template-rows: auto auto;
    gap: 6px 12px;
    align-items:center;
    width:100% !important;
    padding: 12px !important;
    margin-bottom: 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
  }
  #productsTable .col-stockcode{display:block !important;}

  #productsTable td{
    display:block !important;
    padding: 0 !important;
    border: none !important;
  }

  /* layout: left = photo+name (name under photo), middle = stock code + category, right = qty + unit */
  #productsTable td:nth-child(1){ grid-column:1; grid-row:1 / span 2; }
  #productsTable td:nth-child(2){ grid-column:2; grid-row:1; }
  #productsTable td:nth-child(3){ grid-column:2; grid-row:2; }
  #productsTable td:nth-child(4){ grid-column:3; grid-row:1; justify-self:end; text-align:right; }
  #productsTable td:nth-child(5){ grid-column:3; grid-row:2; justify-self:end; text-align:right; }

  /* hide "Son İşlem" and "Sil" on mobile */
  #productsTable td:nth-child(6),
  #productsTable td:nth-child(7){ display:none !important; }

  /* photo+name vertical */
  #productsTable td:nth-child(1) .d-flex{
    flex-direction:column !important;
    align-items:flex-start !important;
    gap: 8px !important;
  }
  #productsTable td:nth-child(1) img.product-photo-thumb{
    width: 56px !important;
    height: 56px !important;
    border-radius: 12px !important;
  }
  #productsTable td:nth-child(1) .rounded-3{
    width:56px !important;
    height:56px !important;
    border-radius:12px !important;
  }
  #productsTable td:nth-child(1) .fw-bold{
    font-size: 14px !important;
    line-height: 1.15 !important;
    max-width: 72px;
    word-break: break-word;
  }

  /* stock code look */
  #productsTable td:nth-child(2){
    font-size: 13px !important;
    font-weight: 800 !important;
    letter-spacing: .3px;
    color: #e2e8f0 !important;
  }

  /* category badge */
  #productsTable td:nth-child(3) .badge{
    font-size: 12px !important;
    padding: 6px 10px !important;
    border-radius: 12px !important;
  }

  /* qty + unit compact */
  #productsTable td:nth-child(4) .fs-5{ font-size: 20px !important; }
  #productsTable td:nth-child(5){ font-size: 13px !important; color: rgba(226,232,240,0.75) !important; }
}

/* hide stock code column on desktop, show via mobile grid */
#productsTable .col-stockcode{display:none;}
#productsTable th.col-stockcode{display:none;}
