/* =====================================================================
   VARIABEL TEMA (Light & Dark) - dikendalikan via [data-bs-theme]
   ===================================================================== */
:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;
  --sidebar-bg: #111827;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #2563eb;
}

[data-bs-theme="dark"] {
  --brand-soft: #16213a;
}

body { font-family: 'Segoe UI', Roboto, -apple-system, sans-serif; }
.bg-purple { background-color: #7c3aed !important; color: #fff; }

/* =====================================================================
   LANDING PAGE
   ===================================================================== */
.landing-hero {
  min-height: 92vh;
  display: flex;
  align-items: center;
  background: radial-gradient(circle at 20% 20%, rgba(37,99,235,.15), transparent 45%),
              radial-gradient(circle at 80% 70%, rgba(124,58,237,.15), transparent 45%);
  position: relative;
  overflow: hidden;
}
.landing-navbar { backdrop-filter: blur(8px); }
.hero-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--brand-soft); color: var(--brand);
  padding: .4rem .9rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
}
.hero-title { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.15; }
.hero-gradient-text {
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.feature-card {
  border: 1px solid var(--bs-border-color);
  border-radius: 1rem;
  padding: 1.75rem;
  height: 100%;
  transition: transform .2s ease, box-shadow .2s ease;
  background: var(--bs-body-bg);
}
.feature-card:hover { transform: translateY(-6px); box-shadow: 0 1rem 2rem rgba(0,0,0,.08); }
.feature-icon {
  width: 52px; height: 52px; border-radius: .9rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; background: var(--brand-soft); margin-bottom: 1rem;
}
.floating-shape {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35; z-index: 0;
}

/* =====================================================================
   LOGIN PAGE
   ===================================================================== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #eff6ff, #ede9fe); }
[data-bs-theme="dark"] .login-page { background: linear-gradient(135deg, #0f172a, #1e1b3a); }
.login-wrapper { width: 100%; max-width: 420px; padding: 1rem; }
.login-card { border-radius: 1.25rem; }
.login-logo { font-size: 3rem; }
.theme-toggle { position: fixed; top: 1rem; right: 1rem; border-radius: 50%; width: 42px; height: 42px; }

/* =====================================================================
   APP LAYOUT (sidebar + topbar)
   ===================================================================== */
.app-sidebar {
  width: 250px; min-height: 100vh; background: var(--sidebar-bg); color: var(--sidebar-text);
  position: fixed; top: 0; left: 0; z-index: 1030; transition: transform .25s ease;
}
.app-sidebar .brand { padding: 1.25rem 1.25rem .5rem; font-weight: 700; color: #fff; font-size: 1.1rem; }
.app-sidebar .nav-link {
  color: var(--sidebar-text); padding: .65rem 1.25rem; border-radius: .5rem; margin: .15rem .75rem;
  display: flex; align-items: center; gap: .65rem; font-size: .92rem;
}
.app-sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.app-sidebar .nav-link.active { background: var(--sidebar-active); color: #fff; }
.app-content { margin-left: 250px; min-height: 100vh; background: var(--bs-tertiary-bg); }
.app-topbar {
  position: sticky; top: 0; z-index: 1020; background: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color); padding: .75rem 1.5rem;
}
.sidebar-toggle-btn { display: none; }
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.show { transform: translateX(0); }
  .app-content { margin-left: 0; }
  .sidebar-toggle-btn { display: inline-flex; }
}

/* =====================================================================
   KOMPONEN UMUM
   ===================================================================== */
.stat-card { border-radius: 1rem; border: 1px solid var(--bs-border-color); }
.stat-icon { width: 48px; height: 48px; border-radius: .8rem; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.table-actions .btn { padding: .25rem .5rem; }
.badge-status-habis { background: #dc2626; color: #fff; }
.badge-status-tersedia { background: #16a34a; color: #fff; }
.loading-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.15); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
.toast-container { z-index: 2100; }

/* =====================================================================
   DASHBOARD REAL-TIME (polling)
   ===================================================================== */
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #16a34a; margin-right: 4px; animation: live-pulse 1.6s ease-in-out infinite;
}
.live-dot-off { background: #dc2626; animation: none; }
@keyframes live-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(22,163,74,.5); }
  50% { opacity: .6; box-shadow: 0 0 0 4px rgba(22,163,74,0); }
}
.stat-updated { animation: stat-flash .9s ease; }
@keyframes stat-flash {
  0% { color: var(--brand); transform: scale(1.15); }
  100% { color: inherit; transform: scale(1); }
}
