/* =====================================================================
   Inventory Promosi — custom styles
   ===================================================================== */

/* Scrollbar (webkit) */
::-webkit-scrollbar           { width: 10px; height: 10px; }
::-webkit-scrollbar-track     { background: #f1f1f1; }
::-webkit-scrollbar-thumb     { background: #c0c0c8; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #a0a0aa; }

/* Hide Alpine cloaked elements until ready */
[x-cloak] { display: none !important; }

/* ---------- Toast animation ---------- */
.toast-enter {
  animation: toast-slide-in 0.25s ease-out both;
}
.toast-leave {
  animation: toast-fade-out 0.25s ease-in both;
}
@keyframes toast-slide-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-fade-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

/* ---------- Spinner ---------- */
.spinner {
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  width: 18px; height: 18px;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.spinner-dark {
  border: 3px solid rgba(200, 16, 46, 0.2);
  border-top-color: #C8102E;
  border-radius: 50%;
  width: 28px; height: 28px;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sidebar transition on mobile ---------- */
.sidebar {
  transition: transform 0.25s ease-out;
}
@media (max-width: 768px) {
  .sidebar-closed {
    transform: translateX(-100%);
  }
}

/* ---------- Table row highlight ---------- */
tr.row-out-of-stock { background: #fee2e2 !important; }
tr.row-out-of-stock:hover { background: #fecaca !important; }
tr.row-low-stock    { background: #fef3c7 !important; }
tr.row-low-stock:hover { background: #fde68a !important; }

/* ---------- Loading overlay ---------- */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.25);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}

/* ---------- Login gradient ---------- */
.login-bg {
  background: linear-gradient(135deg, #C8102E 0%, #7a0a1d 100%);
}

/* ---------- Nav item active ---------- */
.nav-item-active {
  background: rgba(200, 16, 46, 0.15);
  color: #C8102E !important;
  border-left: 3px solid #C8102E;
}

/* ---------- Modal backdrop ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 1rem;
}

/* ---------- Focus ring consistency ---------- */
input:focus, select:focus, textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.2);
  border-color: #C8102E !important;
}

/* ---------- Print friendly (optional) ---------- */
@media print {
  .no-print { display: none !important; }
}
