/* ================================================================
   INVENTORYHUB — base.css (GLOBAL LIGHT MODE)
   Design tokens, layout, sidebar, topbar, shared components
   ================================================================ */

/* ── 1. Design Tokens ─────────────────────────────────────────── */
:root {
  --bg:            #f8fafc; /* Latar belakang utama (abu-abu sangat muda) */
  --bg-2:          #f1f5f9;
  --bg-card:       #ffffff; /* Latar belakang kartu (putih bersih) */
  --bg-glass:      rgba(255, 255, 255, 0.95);
  --bg-sidebar:    #ffffff;

  /* Warna Utama (Menggantikan Neon/Cyan lama menjadi Royal Blue) */
  --neon:          #1d4ed8; 
  --neon-dim:      #eff6ff;
  --neon-border:   #bfdbfe;
  --cyan:          #3b82f6; 
  
  --orange:        #ea580c;
  --orange-dim:    #fff7ed;
  --orange-border: #fed7aa;
  
  --blue:          #0284c7;
  --blue-dim:      #f0f9ff;
  --blue-border:   #bae6fd;
  
  --purple:        #9333ea;
  --purple-dim:    #faf5ff;
  --purple-border: #e9d5ff;
  
  --yellow:        #ca8a04;
  --yellow-dim:    #fefce8;
  --yellow-border: #fef08a;
  
  --red:           #dc2626;
  --red-dim:       #fef2f2;
  --red-border:    #fecaca;

  /* Teks */
  --text-primary:  #0f172a; /* Teks utama (Slate 900) */
  --text-soft:     #475569; /* Teks sekunder (Slate 600) */
  --text-muted:    #94a3b8; /* Teks pudar (Slate 400) */

  --border:        #e2e8f0;
  --border-hover:  #cbd5e1;

  --sidebar-w:     250px;
  --topbar-h:      64px;
  
  --radius:        14px;
  --radius-sm:     9px;
  --radius-lg:     20px;

  --ease:    cubic-bezier(0.4, 0, 0.2, 1);
  --dur:     0.22s;
}

/* ── 2. Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', 'Instrument Sans', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
}

/* Shared grid overlay (Halus untuk Light Mode) */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(29, 78, 216, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 78, 216, 0.03) 1px, transparent 1px);
  background-size: 54px 54px;
}

/* Ambient orbs */
.orb {
  position: fixed; border-radius: 50%; filter: blur(100px);
  z-index: 0; pointer-events: none; opacity: 0.5;
}
.orb-1 { width: 400px; height: 400px; top: -100px; left: -100px;
  background: radial-gradient(circle, rgba(59,130,246,0.15), transparent 70%); }
.orb-2 { width: 300px; height: 300px; bottom: -80px; right: -80px;
  background: radial-gradient(circle, rgba(29,78,216,0.12), transparent 70%); }

h1, h2, h3, h4 { font-family: 'Syne', sans-serif; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── 3. Sidebar Overlay ───────────────────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(3px); z-index: 80;
}
.sidebar-overlay.active { display: block; }

/* ── 4. Sidebar ───────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 90;
  transition: transform var(--dur) var(--ease);
  box-shadow: 4px 0 24px rgba(0,0,0,0.02);
}

.sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; }
.sidebar-logo-mark {
  width: 32px; height: 32px;
  background: var(--neon-dim); border: 1.5px solid var(--neon-border);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--neon); overflow: hidden;
}
.sidebar-logo-text {
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: 1.1rem; letter-spacing: -0.02em; color: var(--text-primary);
}
.sidebar-logo-text .accent { color: var(--neon); }

.sidebar-close-btn {
  display: none; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 7px; color: var(--text-muted);
  transition: all var(--dur);
}
.sidebar-close-btn:hover { color: var(--red); background: var(--red-dim); }

/* Nav */
.sidebar-nav { flex: 1; padding: 14px 12px; overflow-y: auto; }
.sidebar-nav-label {
  font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); padding: 0.25rem 10px 0.5rem; font-family: 'Syne', sans-serif; font-weight: 700;
}
.sidebar-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin: 2px 0; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600; color: var(--text-soft);
  transition: all var(--dur); position: relative;
}
.sidebar-nav-item:hover { color: var(--text-primary); background: var(--bg-2); }
.sidebar-nav-item.active {
  color: var(--neon); background: var(--neon-dim);
  border: 1px solid var(--neon-border); font-weight: 700;
}
.sidebar-nav-icon {
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; opacity: 0.8; transition: color var(--dur);
}
.sidebar-nav-item.active .sidebar-nav-icon,
.sidebar-nav-item:hover .sidebar-nav-icon { opacity: 1; color: var(--neon); }
.sidebar-active-pip {
  width: 6px; height: 6px; background: var(--neon); border-radius: 50%;
  box-shadow: 0 0 6px rgba(29, 78, 216, 0.4); margin-left: auto; flex-shrink: 0;
}

/* Sidebar footer */
.sidebar-footer { border-top: 1px solid var(--border); padding: 16px 14px; flex-shrink: 0; }
.sidebar-user {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.sidebar-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--neon), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem; font-family: 'Syne', sans-serif;
  color: #fff; flex-shrink: 0;
}
.sidebar-user-name { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.sidebar-user-role { font-size: 0.72rem; color: var(--text-soft); }

.btn-logout {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--red-border);
  color: var(--red); font-size: 0.82rem; font-weight: 700;
  transition: all var(--dur);
}
.btn-logout:hover {
  background: var(--red); color: white;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
  transform: translateY(-1px);
}

/* ── 5. Main layout ───────────────────────────────────────────── */
.main-content, .main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  position: relative; z-index: 1;
  transition: margin-left var(--dur) var(--ease);
}
.main-wrapper { display: flex; flex-direction: column; }

/* ── 6. Topbar ────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h); padding: 0 26px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 60;
}
.topbar-left  { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.hamburger-btn {
  display: none; flex-direction: column; gap: 5px;
  padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); transition: all var(--dur);
}
.hamburger-btn:hover { border-color: var(--neon); background: var(--neon-dim); }
.hamburger-btn span {
  display: block; width: 18px; height: 2px;
  background: var(--text-soft); border-radius: 99px; transition: background var(--dur);
}
.hamburger-btn:hover span { background: var(--neon); }

.topbar-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; font-weight: 600; color: var(--text-soft);
}
.breadcrumb-sep   { color: var(--text-muted); }
.breadcrumb-current { color: var(--text-primary); font-weight: 700; }

.date-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--neon-dim); border: 1px solid var(--neon-border);
  padding: 6px 14px; border-radius: 99px; font-size: 0.75rem; font-weight: 700; color: var(--neon);
}

/* ── 7. Glass card (Diubah jadi Solid White Card) ─────────────── */
.glass-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  transition: box-shadow var(--dur), border-color var(--dur);
}
.glass-card:hover { border-color: var(--neon-border); box-shadow: 0 6px 24px rgba(29, 78, 216, 0.06); }

.card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 0.95rem; font-weight: 800; font-family: 'Syne', sans-serif; letter-spacing: -0.01em; color: var(--text-primary); }
.card-sub   { font-size: 0.75rem; color: var(--text-soft); margin-top: 4px; }
.card-pad   { padding: 20px 24px; }

/* ── 8. Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 99px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em; font-family: 'Syne', sans-serif;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.badge-neon   { background: var(--neon-dim);    color: var(--neon);   border: 1px solid var(--neon-border); }
.badge-orange { background: var(--orange-dim);  color: var(--orange); border: 1px solid var(--orange-border); }
.badge-blue   { background: var(--blue-dim);    color: var(--blue);   border: 1px solid var(--blue-border); }
.badge-purple { background: var(--purple-dim);  color: var(--purple); border: 1px solid var(--purple-border); }
.badge-yellow { background: var(--yellow-dim);  color: var(--yellow); border: 1px solid var(--yellow-border); }
.badge-red    { background: var(--red-dim);     color: var(--red);    border: 1px solid var(--red-border); }

/* ── 9. Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 400px; }
thead th {
  padding: 12px 18px; text-align: left;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-soft); background: var(--bg-2);
  border-bottom: 1px solid var(--border); font-family: 'Syne', sans-serif; white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--dur); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-2); }
tbody td { padding: 14px 18px; font-size: 0.85rem; vertical-align: middle; color: var(--text-primary); }
.col-bar { width: 100px; }
.product-name { font-weight: 600; max-width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qty-neon   { color: var(--neon);   font-weight: 700; font-family: 'Syne', sans-serif; }
.qty-orange { color: var(--orange); font-weight: 700; font-family: 'Syne', sans-serif; }
.empty-row  { text-align: center; color: var(--text-muted); padding: 3rem; font-size: 0.85rem; }

/* ── 10. Rank badges ──────────────────────────────────────────── */
.rank-badge {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 800; font-family: 'Syne', sans-serif;
  background: var(--bg-2); color: var(--text-soft); flex-shrink: 0;
  border: 1px solid var(--border);
}
.rank-1    { background: #fefce8; color: #ca8a04; border-color: #fef08a; }
.rank-2    { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.rank-3    { background: #fff7ed; color: #ea580c; border-color: #ffedd5; }
.rank-fast { background: var(--neon-dim);    color: var(--neon); border-color: var(--neon-border); }
.rank-slow { background: var(--orange-dim);  color: var(--orange); border-color: var(--orange-border); }

/* ── 11. Progress bars ────────────────────────────────────────── */
.progress-bg { width: 100%; height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 99px; transition: width 1s var(--ease); }
.progress-neon   { background: linear-gradient(90deg, var(--neon),   var(--cyan)); }
.progress-orange { background: linear-gradient(90deg, var(--orange), #f97316); }

/* ── 12. Animations ───────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim-up { animation: fadeUp 0.5s var(--ease) both; }
.d1{animation-delay:.05s} .d2{animation-delay:.10s} .d3{animation-delay:.15s}
.d4{animation-delay:.20s} .d5{animation-delay:.25s} .d6{animation-delay:.30s}

/* ── 13. Chart legend ─────────────────────────────────────────── */
.chart-legend { display: flex; gap: 1.2rem; align-items: center; flex-shrink: 0; }
.legend-item  { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; color: var(--text-soft); font-weight: 600; }
.legend-dot   { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── 14. Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.active { transform: translateX(0); box-shadow: 12px 0 40px rgba(0,0,0,0.1); }
  .sidebar-close-btn { display: flex; }
  .main-content, .main-wrapper { margin-left: 0; }
  .hamburger-btn { display: flex; }
}
@media (min-width: 1025px) {
  .sidebar { transform: translateX(0) !important; }
  .main-content, .main-wrapper { margin-left: var(--sidebar-w); }
  .sidebar-close-btn { display: none !important; }
  .sidebar-overlay  { display: none !important; }
  .hamburger-btn    { display: none !important; }
}
@media (max-width: 600px) {
  .date-chip { display: none; }
}