/* Tema "Warehouse App" untuk seluruh halaman backend Next - WMS. */
:root {
  --bg: #eef1f7; --surface: #ffffff; --surface-2: #f8fafc; --border: #e2e8f0; --border-2: #cbd5e1;
  --text: #0f172a; --muted: #64748b; --primary: #5b5ff0; --primary-d: #4a4ee0; --primary-soft: #eef0ff;
  --brand: #2b4acb; --success: #22c55e; --danger: #ef4444; --radius: 14px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 14px rgba(15,23,42,.05);
}
html.dark {
  --bg: #0b1220; --surface: #131c2e; --surface-2: #182236; --border: #25324a; --border-2: #33425f;
  --text: #e5eaf5; --muted: #93a1bb; --primary: #7c80ff; --primary-d: #6a6ef5; --primary-soft: #1d2547;
  --brand: #8ea2ff; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25);
}
html, body { font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
body { background: var(--bg) !important; color: var(--text); }

/* ---------- Shell ---------- */
.app-sidebar { position: fixed; inset: 0 auto 0 0; width: 256px; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 40; transition: transform .2s ease; }
.app-main { margin-left: 256px; min-height: 100vh; transition: margin .2s ease; }
body.sb-hidden .app-sidebar { transform: translateX(-100%); }
body.sb-hidden .app-main { margin-left: 0; }
.app-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 35; }
@media (max-width: 1023px) {
  .app-sidebar { transform: translateX(-100%); box-shadow: 0 10px 40px rgba(0,0,0,.2); }
  body.sb-open .app-sidebar { transform: translateX(0); }
  body.sb-open .app-overlay { display: block; }
  .app-main, body.sb-hidden .app-main { margin-left: 0; }
}
.brand, .brand * { text-decoration: none !important; color: var(--text); }
.brand small { color: #0ea5e9 !important; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.brand img { height: 36px; width: auto; background: #fff; border-radius: 10px; padding: 3px; border: 1px solid var(--border); }
.brand b { display: block; font-size: 17px; font-weight: 800; line-height: 1.1; }
.brand small { display: block; font-size: 10.5px; letter-spacing: .12em; color: #0ea5e9; font-weight: 700; text-transform: uppercase; margin-top: 2px; }
.nav-scroll { flex: 1; overflow-y: auto; padding: 8px 10px 12px; }
.nav-label { font-size: 10.5px; letter-spacing: .14em; color: var(--muted); font-weight: 700; text-transform: uppercase; padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; margin-bottom: 2px;
  color: var(--text); border: 1px solid transparent; position: relative; text-decoration: none; }
.nav-item:hover { background: var(--surface-2); }
.nav-item svg { width: 22px; height: 22px; flex: none; color: var(--text); opacity: .85; }
.nav-item .t { font-size: 14px; font-weight: 700; line-height: 1.15; }
.nav-item .s { font-size: 11.5px; color: var(--muted); line-height: 1.2; margin-top: 1px; }
.nav-item.active { background: linear-gradient(90deg, var(--primary-soft), transparent 140%); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.nav-item.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 4px; background: var(--primary); }
.nav-item.active svg, .nav-item.active .t { color: var(--primary); opacity: 1; }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.side-foot { border-top: 1px solid var(--border); padding: 12px; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.avatar { width: 38px; height: 38px; border-radius: 999px; background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.user-card b { display: block; font-size: 13px; text-transform: uppercase; line-height: 1.15; }
.user-card small { font-size: 11.5px; color: var(--muted); }
.logout-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; margin-top: 8px; border-radius: 12px; color: var(--text); background: none; border: 0; cursor: pointer; }
.logout-row:hover { background: var(--surface-2); }
.logout-row svg { width: 22px; height: 22px; color: var(--danger); }
.logout-row .t { font-size: 14px; font-weight: 700; } .logout-row .s { font-size: 11.5px; color: var(--muted); }

.topbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 10px 20px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text);
  display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--primary-soft); }
.icon-btn svg { width: 20px; height: 20px; }
.page-title { font-size: 17px; font-weight: 800; line-height: 1.15; }
.page-sub { font-size: 12px; color: var(--muted); }
.pill-online { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #15803d; background: #dcfce7;
  border: 1px solid #86efac; border-radius: 999px; padding: 4px 11px; }
.pill-online i { width: 7px; height: 7px; border-radius: 99px; background: #22c55e; display: inline-block; }
.pill-online.off { color: #b91c1c; background: #fee2e2; border-color: #fca5a5; } .pill-online.off i { background: #ef4444; }
html.dark .pill-online { background: #0f2b1b; border-color: #166534; color: #86efac; }
.btn-keluar { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #dc2626; border: 1px solid #fecaca;
  background: #fef2f2; border-radius: 12px; padding: 9px 14px; cursor: pointer; }
.btn-keluar:hover { background: #fee2e2; }
html.dark .btn-keluar { background: #2a1416; border-color: #5b1d22; color: #f87171; }
.content-wrap { padding: 20px 16px 40px; }

/* ---------- Restyle global halaman lama (Tailwind) ---------- */
.bg-white { background-color: var(--surface) !important; }
.bg-gray-50 { background-color: var(--surface-2) !important; }
.bg-gray-100 { background-color: color-mix(in srgb, var(--muted) 12%, var(--surface)) !important; }
.border, .border-t, .border-b, .border-l, .border-r { border-color: var(--border); }
.divide-y > * + * { border-color: var(--border) !important; }
.text-gray-800, .text-gray-900, .text-gray-700 { color: var(--text) !important; }
.text-gray-600, .text-gray-500 { color: var(--muted) !important; }
.text-gray-400 { color: color-mix(in srgb, var(--muted) 80%, transparent) !important; }
.bg-white.border, .bg-white.rounded-lg, .bg-white.rounded-xl, .bg-white.shadow-sm { border-radius: var(--radius) !important; box-shadow: var(--shadow); border-color: var(--border); }
.rounded-lg.border { border-radius: var(--radius); }
.hover\:bg-gray-50:hover { background-color: var(--surface-2) !important; }
table { border-collapse: collapse; }
thead, thead tr, thead th { background: var(--surface-2) !important; }
thead th { font-size: 11.5px !important; text-transform: uppercase; letter-spacing: .05em; font-weight: 700 !important; color: var(--muted) !important; }
tbody tr { border-color: var(--border) !important; }
tfoot, tfoot td { background: var(--surface-2) !important; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  background: var(--surface) !important; color: var(--text); border: 1px solid var(--border-2) !important; border-radius: 10px !important; }
input:not([type=checkbox]):not([type=radio]):focus, select:focus, textarea:focus { outline: none; border-color: var(--primary) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
input[type=file] { border-radius: 10px; }
button, .btn { font-weight: 600; }
.bg-teal-700, .bg-teal-600, .bg-blue-600, .bg-indigo-600 { background-color: var(--primary) !important; color: #fff !important; }
.hover\:bg-teal-800:hover, .hover\:bg-blue-700:hover, .hover\:bg-teal-700:hover { background-color: var(--primary-d) !important; }
.bg-green-600 { background-color: var(--success) !important; } .hover\:bg-green-700:hover { background-color: #16a34a !important; }
.bg-red-600 { background-color: var(--danger) !important; }
.bg-teal-700, .bg-blue-600, .bg-green-600, .bg-red-600, .bg-amber-600, .bg-slate-700 { border-radius: 10px !important; }
.text-teal-700, .text-blue-600, .text-blue-700 { color: var(--primary) !important; }
.border-teal-700 { border-color: var(--primary) !important; }
.hover\:bg-teal-50:hover, .hover\:bg-blue-50:hover { background-color: var(--primary-soft) !important; }
.bg-teal-50, .bg-blue-50 { background-color: var(--primary-soft) !important; }
.bg-green-50 { background-color: color-mix(in srgb, #22c55e 12%, var(--surface)) !important; }
.bg-red-50 { background-color: color-mix(in srgb, #ef4444 10%, var(--surface)) !important; }
.bg-amber-50, .bg-amber-100 { background-color: color-mix(in srgb, #f59e0b 14%, var(--surface)) !important; }
.bg-gray-200 { background-color: color-mix(in srgb, var(--muted) 25%, var(--surface)) !important; }
h1.text-xl, h2.text-xl { font-weight: 800; }
h2.font-semibold.mb-1, h2.font-semibold.mb-2, h2.text-sm.font-semibold { color: var(--brand); }
a.text-blue-700:hover, a.text-blue-600:hover { text-decoration: underline; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; }

/* ---------- Komponen dashboard ---------- */
.hero { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 20px 22px; }
.hero h2 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.chip-live { font-size: 11px; font-weight: 600; color: #059669; background: #d1fae5; border: 1px solid #6ee7b7; border-radius: 999px; padding: 2px 10px; vertical-align: middle; margin-left: 8px; }
html.dark .chip-live { background: #052e22; border-color: #065f46; color: #6ee7b7; }
.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat-card { border-radius: 18px; border: 1px solid var(--border); padding: 16px; box-shadow: var(--shadow); background: var(--surface); position: relative; overflow: hidden; }
.stat-card .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); }
.stat-card .ico svg { width: 22px; height: 22px; }
.stat-card .lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-top: 14px; color: var(--text); }
.stat-card .num { font-size: 34px; font-weight: 800; line-height: 1.1; margin-top: 4px; }
.stat-card .note { font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px; }
.tone-blue { background: linear-gradient(160deg, color-mix(in srgb, #38bdf8 14%, var(--surface)), var(--surface) 60%); } .tone-blue .ico { color: #0ea5e9; }
.tone-green { background: linear-gradient(160deg, color-mix(in srgb, #34d399 14%, var(--surface)), var(--surface) 60%); } .tone-green .ico { color: #10b981; }
.tone-amber { background: linear-gradient(160deg, color-mix(in srgb, #fbbf24 16%, var(--surface)), var(--surface) 60%); } .tone-amber .ico { color: #f59e0b; }
.tone-violet { background: linear-gradient(160deg, color-mix(in srgb, #a78bfa 16%, var(--surface)), var(--surface) 60%); } .tone-violet .ico { color: #8b5cf6; }
.tone-rose { background: linear-gradient(160deg, color-mix(in srgb, #fb7185 14%, var(--surface)), var(--surface) 60%); } .tone-rose .ico { color: #f43f5e; }
.card-box { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 18px 20px; }
.card-box > h3 { font-size: 16px; font-weight: 800; }
.num-pill { display: inline-block; min-width: 34px; text-align: center; font-weight: 700; font-size: 12px; border-radius: 8px; padding: 2px 8px; border: 1px solid; }
.num-pill.blue { color: #0284c7; background: #e0f2fe; border-color: #bae6fd; } .num-pill.green { color: #059669; background: #d1fae5; border-color: #a7f3d0; }
.num-pill.amber { color: #d97706; background: #fef3c7; border-color: #fde68a; } .num-pill.rose { color: #e11d48; background: #ffe4e6; border-color: #fecdd3; }
html.dark .num-pill.blue { background: #0c2a3d; border-color: #155e75; color: #7dd3fc; } html.dark .num-pill.green { background: #052e22; border-color: #065f46; color: #6ee7b7; }
html.dark .num-pill.amber { background: #3a2a07; border-color: #78350f; color: #fcd34d; } html.dark .num-pill.rose { background: #3b0d17; border-color: #881337; color: #fda4af; }
