/* ============================================
   IHC COMMAND CENTER — Modern Solid UI v3
   Dark premium · Borderless · Glass morphism
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* ── Solid dark backgrounds ── */
  --bg-primary: #06060b;
  --bg-secondary: #0e0e16;
  --bg-tertiary: #16161f;
  --bg-card: #111119;
  --bg-elevated: #1a1a25;
  --bg-glass: rgba(14, 14, 22, 0.85);

  /* ── Borders (subtle) ── */
  --border: rgba(255, 255, 255, 0.05);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(99, 102, 241, 0.25);

  /* ── Accent colors (vivid) ── */
  --accent: #818cf8;
  --accent-solid: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.20);
  --accent-light: rgba(99, 102, 241, 0.12);

  --success: #34d399;
  --success-solid: #10b981;
  --success-light: rgba(16, 185, 129, 0.15);
  --success-glow: rgba(16, 185, 129, 0.25);

  --warning: #fbbf24;
  --warning-solid: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.12);

  --danger: #f87171;
  --danger-solid: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.12);

  --info: #22d3ee;
  --info-solid: #06b6d4;
  --info-light: rgba(6, 182, 212, 0.12);

  --purple: #a78bfa;
  --purple-solid: #8b5cf6;
  --purple-light: rgba(139, 92, 246, 0.12);

  --rose: #fb7185;
  --rose-solid: #f43f5e;
  --rose-light: rgba(244, 63, 94, 0.12);

  /* ── Text ── */
  --text: #f1f5f9;
  --text-secondary: #b8bcc8;
  --text-muted: #6b7280;

  /* ── Layout ── */
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); background: var(--bg-primary); color: var(--text);
  line-height: 1.6; font-size: 16px; -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word; word-break: break-word;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }
::selection { background: rgba(129, 140, 248, 0.35); }

/* ─── LAYOUT ─── */
.app { display: flex; min-height: 100vh; }
.main {
  flex: 1; margin-left: var(--sidebar-width); padding: 24px 28px;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}

/* ─── SIDEBAR — Glass + Solid ─── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width);
  background: var(--bg-secondary);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 40;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto; overflow-x: hidden;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 12px; padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}
.logo-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 50%, #4f46e5 100%);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; color: #fff; flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}
.logo-text h2 { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.2; }
.logo-text span { font-size: 12px; color: var(--text-muted); font-weight: 500; }

.sidebar-section { padding: 16px 10px 4px; }
.sidebar-section-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text-muted); font-weight: 700; padding: 0 10px; margin-bottom: 6px;
  opacity: 0.7;
}

.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 14px; border-radius: var(--radius-sm); border: none;
  background: transparent; color: var(--text-muted); font-size: 14px;
  font-weight: 500; cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none; font-family: var(--font); position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text-secondary); }
.nav-item.active {
  background: var(--accent-light); color: var(--accent);
  font-weight: 600; box-shadow: 0 0 20px rgba(99, 102, 241, 0.08);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 4px 4px 0; background: var(--accent);
  box-shadow: 0 0 8px var(--accent-solid);
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.8; }
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--danger, #ef4444); color: #fff;
  font-size: 11px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; line-height: 1; animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.7; } }

.sidebar-footer {
  margin-top: auto; padding: 14px; border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex; align-items: center; gap: 12px; padding: 10px;
  border-radius: var(--radius-sm);
}
.sidebar-avatar {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-solid), var(--purple-solid));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
}
.sidebar-user-info .name { font-size: 14px; font-weight: 600; color: var(--text); }
.sidebar-user-info .role { font-size: 12px; color: var(--text-muted); text-transform: capitalize; }
.btn-logout {
  width: 100%; margin-top: 10px; padding: 9px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.06); background: transparent; color: var(--text-muted);
  font-size: 13px; cursor: pointer; transition: all 0.2s ease; font-family: var(--font);
}
.btn-logout:hover { border-color: var(--danger-solid); color: var(--danger); background: var(--danger-light); }

/* ─── PAGE HEADER ─── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
}
.page-header h1 {
  font-size: clamp(22px, 3.5vw, 32px); font-weight: 800; letter-spacing: -0.03em;
  background: linear-gradient(135deg, #f1f5f9 0%, #94a3b8 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.page-header p { font-size: 15px; color: var(--text-muted); margin-top: 4px; }
.page-actions { display: flex; gap: 10px; align-items: center; }

/* ─── KPI CARDS — Solid with color stripe ─── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi-card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 24px; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative; overflow: hidden; min-height: 130px;
  display: flex; flex-direction: column; justify-content: center;
  border: 1px solid var(--border);
}
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent-solid), var(--purple-solid));
  opacity: 0.7;
}
.kpi-card:nth-child(2)::before { background: linear-gradient(90deg, var(--success-solid), #059669); }
.kpi-card:nth-child(3)::before { background: linear-gradient(90deg, var(--info-solid), #0284c7); }
.kpi-card:nth-child(4)::before { background: linear-gradient(90deg, var(--danger-solid), #dc2626); }
.kpi-card:nth-child(5)::before { background: linear-gradient(90deg, var(--warning-solid), #d97706); }
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06);
}
.kpi-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.kpi-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kpi-icon svg { width: 24px; height: 24px; }
.kpi-trend { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 2px; }
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-value {
  font-size: clamp(22px, 3vw, 32px); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 4px;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi-label { font-size: 14px; color: var(--text-muted); font-weight: 500; }

/* ─── CARDS — Solid, elevated ─── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); transition: all 0.2s ease; overflow: hidden;
  min-width: 0;
}
.card:hover { border-color: var(--border-hover); box-shadow: 0 8px 32px rgba(0,0,0,0.25); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.card-body { padding: 24px; }
.card-body.flush { padding: 0; overflow-x: auto; }

/* ─── GRID LAYOUTS ─── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* ─── TABLE — Clean, no heavy borders ─── */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 12px 20px; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); font-weight: 600;
  border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.015);
}
.table td {
  padding: 14px 20px; font-size: 15px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
.table tbody tr { transition: all 0.15s ease; }
.table tbody tr:hover td { background: rgba(99, 102, 241, 0.04); }
.table tbody tr:last-child td { border-bottom: none; }

/* ─── BADGES — Solid color, 20% opacity bg ─── */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px;
  border-radius: var(--radius-xs); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-accent { background: var(--accent-light); color: var(--accent); }
.badge-muted { background: rgba(107,114,128,0.12); color: var(--text-muted); }
.badge-rose { background: var(--rose-light); color: var(--rose); }

/* ─── BUTTONS — Solid, clean ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font); text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
  transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}
.btn-secondary {
  background: var(--bg-elevated); color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.08);
}
.btn-secondary:hover { border-color: var(--border-hover); color: var(--text); background: var(--bg-tertiary); }
.btn-danger { background: var(--danger-light); color: var(--danger); }
.btn-danger:hover { background: var(--danger-solid); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--accent); background: var(--accent-light); }
.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-success { background: var(--success-light); color: var(--success); }
.btn-success:hover { background: var(--success-solid); color: #fff; }

/* ─── FORMS — Solid dark inputs ─── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.input, .select {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.06); background: var(--bg-tertiary);
  color: var(--text); font-size: 15px; font-family: var(--font);
  transition: all 0.2s ease;
}
.input:focus, .select:focus {
  outline: none; border-color: var(--accent-solid);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12), 0 0 16px rgba(99, 102, 241, 0.06);
  background: var(--bg-elevated);
}
.input::placeholder { color: var(--text-muted); opacity: 0.6; }
select.select {
  appearance: none; cursor: pointer; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 12L2 6h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}

/* ─── FILTER BAR ─── */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-btn {
  padding: 7px 16px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.06);
  background: var(--bg-tertiary); color: var(--text-muted); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease; font-family: var(--font);
}
.filter-btn:hover { border-color: var(--accent-solid); color: var(--accent); }
.filter-btn.active {
  background: var(--accent-solid); border-color: var(--accent-solid); color: #fff;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

/* ─── CHART ─── */
.chart-container { width: 100%; height: 320px; }
.chart-body { height: clamp(200px, 30vw, 300px); position: relative; }

/* ─── LIST ITEM ─── */
.list-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 24px;
  border-bottom: 1px solid var(--border); transition: all 0.15s ease; cursor: pointer;
}
.list-item:hover { background: rgba(99, 102, 241, 0.04); }
.list-item:last-child { border-bottom: none; }

/* ─── MODAL — Glass overlay ─── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); width: 90%; max-width: 620px;
  max-height: 85vh; overflow-y: auto; animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-close {
  width: 34px; height: 34px; border-radius: var(--radius-sm); border: none;
  background: rgba(255,255,255,0.04); color: var(--text-muted); cursor: pointer;
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-body { padding: 28px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 28px; border-top: 1px solid var(--border); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ─── SPINNER ─── */
.spinner {
  border: 3px solid rgba(255,255,255,0.06); border-top-color: var(--accent);
  border-radius: 50%; width: 36px; height: 36px; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: flex; justify-content: center; align-items: center; padding: 80px; }

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center; padding: 80px 24px; color: var(--text-muted);
}
.empty-state svg { margin-bottom: 16px; opacity: 0.25; }
.empty-state p { font-size: 15px; }

/* ─── TOAST ─── */
.toast-container { position: fixed; top: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 18px; font-size: 14px; min-width: 320px; animation: toastIn 0.3s ease;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  backdrop-filter: blur(16px);
}
.toast-success { border-left: 3px solid var(--success-solid); }
.toast-danger { border-left: 3px solid var(--danger-solid); }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── DRAG & DROP FG BOARD ─── */
.fg-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); border-color: var(--accent) !important; }
.fg-card:active, .fg-card[draggable]:active { cursor: grabbing; }
.fg-column { transition: border-color 0.2s, box-shadow 0.2s; }
.fg-board::-webkit-scrollbar { height: 6px; }
.fg-board::-webkit-scrollbar-track { background: var(--bg-tertiary); border-radius: 4px; }
.fg-board::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
@media (max-width: 768px) { .fg-board { flex-direction: column; } .fg-column { min-width: 100% !important; max-width: 100% !important; } }

/* ─── PROGRESS BAR ─── */
.progress { height: 6px; border-radius: 9999px; background: var(--bg-tertiary); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 9999px; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }

/* ─── RESPONSIVE UTILITY ─── */
.resp-grid { display: grid; gap: 14px; }
.resp-flex { display: flex; flex-wrap: wrap; gap: 10px; }
.resp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ─── LAPTOP SCALE — use transform not zoom for cross-browser ─── */

/* ─── RESPONSIVE BREAKPOINTS ─── */
.kpi-grid:has(:nth-child(5)) { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid:has(:nth-child(5)) { grid-template-columns: repeat(3, 1fr); }
  .kpi-value { font-size: 24px; }
  .kpi-card { min-height: 100px; padding: 16px; }
  .glass-metrics-grid { grid-template-columns: repeat(3, 1fr); }
  .quick-actions { grid-template-columns: repeat(3, 1fr); }
  .gudang-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .sidebar { width: var(--sidebar-collapsed); }
  .sidebar .logo-text, .sidebar .nav-item span, .sidebar .sidebar-section-label,
  .sidebar .sidebar-user-info, .sidebar .btn-logout, .sidebar .sidebar-bell { display: none; }
  .sidebar .nav-item { justify-content: center; padding: 14px; }
  .sidebar .nav-item svg { width: 22px; height: 22px; opacity: 1; }
  .sidebar .sidebar-logo { justify-content: center; padding: 16px 8px; }
  .sidebar .logo-icon { width: 36px; height: 36px; font-size: 14px; }
  .sidebar .sidebar-footer { padding: 10px 8px; }
  .sidebar .sidebar-user { justify-content: center; padding: 8px; }
  .sidebar .sidebar-avatar { width: 34px; height: 34px; font-size: 12px; }
  .main { margin-left: var(--sidebar-collapsed); padding: 20px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .kpi-card { padding: 16px; }
  .kpi-value { font-size: 24px; }
  .modal .grid-2, .modal .grid-3 { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 26px; }
  .gudang-grid { grid-template-columns: repeat(3, 1fr); }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .glass-metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-width); }
  .sidebar.open { transform: translateX(0); }
  .sidebar .logo-text, .sidebar .nav-item span, .sidebar .sidebar-section-label,
  .sidebar .sidebar-user-info, .sidebar .btn-logout { display: revert; }
  .sidebar .nav-item { justify-content: revert; padding: 9px 14px; }
  .mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 35; }
  .mobile-overlay.show { display: block; }
  .main { margin-left: 0; padding: 14px; padding-top: 68px; }
  .mobile-topbar { display: flex !important; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-value { font-size: 22px; }
  .kpi-card { padding: 14px; min-height: auto; }
  .kpi-icon { width: 40px; height: 40px; }
  .page-header { flex-direction: column; gap: 10px; margin-bottom: 16px; }
  .page-header h1 { font-size: 22px; }
  .page-header p { font-size: 13px; }
  .page-actions { width: 100%; flex-wrap: wrap; }
  .grid-2 { grid-template-columns: 1fr; gap: 10px; }
  .grid-3 { grid-template-columns: 1fr; gap: 10px; }
  .card-body.flush { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card-header { padding: 14px 16px; }
  .card-header h3 { font-size: 15px; }
  .card-body { padding: 16px; }
  .table { min-width: 500px; }
  .table th { padding: 10px 14px; font-size: 11px; }
  .table td { padding: 10px 14px; font-size: 13px; }
  .filter-bar { flex-wrap: wrap; }
  .input, .select { padding: 10px 14px; font-size: 14px; }
  .btn { padding: 10px 16px; font-size: 13px; }
  .btn-sm { padding: 7px 12px; font-size: 11px; }
  .chart-container { height: 220px; }
  .wallet-grid { grid-template-columns: 1fr 1fr; }
  .wallet-balance { font-size: 20px; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; gap: 8px; }
  .kpi-card { flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; min-height: auto; }
  .kpi-value { font-size: 20px; margin-bottom: 0; }
  .kpi-label { font-size: 12px; }
  .kpi-icon { width: 36px; height: 36px; border-radius: 10px; }
  .kpi-icon svg { width: 18px; height: 18px; }
  .kpi-header { margin-bottom: 8px; }
  .main { padding: 10px; padding-top: 62px; }
  .page-header { margin-bottom: 12px; }
  .page-header h1 { font-size: 20px; }
  .card { border-radius: var(--radius-sm); }
  .card-header { padding: 12px 14px; }
  .card-header h3 { font-size: 14px; }
  .card-body { padding: 12px; }
  .table { min-width: 400px; }
  .table th, .table td { padding: 8px 10px; font-size: 12px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; font-size: 12px; padding: 9px 10px; }
  .modal { width: 98%; max-width: none; border-radius: var(--radius-sm); }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 14px; }
  .modal-footer { padding: 12px 14px; }
  .chart-container { height: 180px; }
  .toast { min-width: auto; max-width: calc(100vw - 20px); font-size: 13px; padding: 10px 14px; }
  .toast-container { top: 12px; right: 10px; }
  .filter-bar .select, .filter-bar .input { min-width: 0; flex: 1 1 100%; }
  .wallet-grid { grid-template-columns: 1fr; }
  .wallet-balance { font-size: 18px; }
  .wallet-card { padding: 14px; }
}

/* ─── MOBILE TOPBAR ─── */
.mobile-topbar {
  display: none; position: fixed; top: 0; left: 0; right: 0; height: 56px;
  background: var(--bg-secondary); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 16px; align-items: center; justify-content: space-between; z-index: 30;
}
.hamburger {
  width: 42px; height: 42px; border-radius: var(--radius-sm); border: none;
  background: transparent; color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ─── LOGIN PAGE — Premium dark ─── */
.login-page {
  min-height: 100vh; display: grid; grid-template-columns: 4fr 6fr;
  background: #040408;
}

.login-sidebar {
  padding: 60px 64px;
  background: linear-gradient(168deg, #12102e 0%, #0a0820 35%, #060610 100%);
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
  border-right: 1px solid rgba(99,102,241,0.08);
}
.login-sidebar::before {
  content: ''; position: absolute; top: -160px; left: -100px;
  width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.10) 0%, transparent 55%);
  pointer-events: none;
}
.login-sidebar::after {
  content: ''; position: absolute; bottom: -120px; right: -80px;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,0.06) 0%, transparent 55%);
  pointer-events: none;
}
.login-sidebar-brand { position: relative; z-index: 1; }
.login-sidebar-icon {
  width: 68px; height: 68px; border-radius: 18px;
  background: linear-gradient(140deg, #6366f1 0%, #818cf8 50%, #a78bfa 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; margin-bottom: 28px;
  box-shadow: 0 8px 32px rgba(99,102,241,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
}
.login-sidebar-icon svg { width: 30px; height: 30px; }
.login-sidebar h1 {
  font-size: 52px; font-weight: 800; line-height: 1.05; margin-bottom: 6px;
  letter-spacing: -1.5px;
}
.login-sidebar h1 span { display: block; }
.login-sidebar h1 span:first-child {
  background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.login-sidebar h1 span:last-child {
  background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  font-size: 44px; letter-spacing: -1px;
}
.login-sidebar .tagline {
  font-size: 16px; color: #6b7994; font-style: italic;
  margin: 28px 0 40px; padding-left: 18px;
  border-left: 2px solid rgba(99,102,241,0.35);
  line-height: 1.7;
}
.login-features { list-style: none; padding: 0; margin: 0; }
.login-features li {
  font-size: 15px; color: #7b8ba5; padding: 12px 0;
  display: flex; align-items: center; gap: 14px;
  transition: color 0.2s; letter-spacing: 0.1px;
}
.login-features li:hover { color: #cbd5e1; }
.login-feature-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-solid);
  box-shadow: 0 0 10px rgba(99,102,241,0.5);
}

.login-sidebar-footer {
  position: relative; z-index: 1;
  padding-top: 32px; margin-top: 36px;
  border-top: 1px solid rgba(99,102,241,0.08);
}
.login-sidebar-stats { display: flex; gap: 40px; }
.login-stat { display: flex; flex-direction: column; gap: 4px; }
.login-stat-num {
  font-size: 36px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, #c7d2fe, #818cf8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.login-stat-label {
  font-size: 12px; color: #4b5563; text-transform: uppercase;
  letter-spacing: 0.8px; font-weight: 600;
}

.login-main {
  display: flex; align-items: center; justify-content: center;
  padding: 48px 80px;
  background:
    radial-gradient(ellipse at 25% 15%, rgba(99,102,241,0.03) 0%, transparent 50%),
    #040408;
}
.login-card { width: 100%; max-width: 640px; }
.login-welcome { margin-bottom: 40px; }
.login-welcome h2 {
  font-size: 40px; font-weight: 800; margin-bottom: 12px;
  color: #f1f5f9; letter-spacing: -0.5px;
}
.login-welcome p { font-size: 16px; color: #64748b; line-height: 1.5; }

.login-field { position: relative; margin-bottom: 24px; }
.login-field label {
  display: block; font-weight: 600; color: #7b8ba5;
  margin-bottom: 10px; letter-spacing: 0.4px; text-transform: uppercase;
  font-size: 12px;
}
.login-field input {
  width: 100%; padding: 18px 20px; border-radius: 12px;
  border: 1.5px solid rgba(255,255,255,0.06); background: rgba(14,14,22,0.8);
  color: #f1f5f9; font-size: 16px; font-family: var(--font);
  transition: all 0.2s ease;
}
.login-field input::placeholder { color: #4b5563; }
.login-field input:focus {
  outline: none; border-color: var(--accent-solid);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12), 0 0 20px rgba(99,102,241,0.06);
  background: var(--bg-elevated);
}
.login-btn {
  width: 100%; padding: 20px 24px; border-radius: 14px; border: none;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 10px; letter-spacing: 0.5px; text-transform: uppercase;
  box-shadow: 0 4px 20px rgba(99,102,241,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}
.login-btn:hover {
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(99,102,241,0.4), inset 0 1px 0 rgba(255,255,255,0.12);
}
.login-btn:active { transform: translateY(0); box-shadow: 0 2px 12px rgba(99,102,241,0.3); }

.login-error {
  background: var(--danger-light); color: var(--danger); padding: 14px 16px;
  border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid rgba(239,68,68,0.15);
}

.login-divider {
  display: flex; align-items: center; gap: 14px; margin: 36px 0 22px;
  font-size: 11px; color: #4b5563; text-transform: uppercase;
  letter-spacing: 1.8px; font-weight: 700;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(255,255,255,0.05);
}

.login-accounts { margin-bottom: 10px; }
.login-account-row {
  display: flex; align-items: center; gap: 16px; padding: 14px 16px;
  border-radius: 12px; cursor: pointer; transition: all 0.2s ease;
  border: 1px solid transparent;
}
.login-account-row:hover {
  background: rgba(99,102,241,0.05);
  border-color: rgba(99,102,241,0.12);
}
.login-account-badge {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}
.login-account-badge.owner { background: linear-gradient(140deg, #6366f1, #818cf8); }
.login-account-badge.treasury { background: linear-gradient(140deg, #0284c7, #22d3ee); }
.login-account-badge.admin { background: linear-gradient(140deg, #d97706, #fbbf24); }
.login-account-badge.gudang { background: linear-gradient(140deg, #059669, #34d399); }
.login-account-badge.sales { background: linear-gradient(140deg, #db2777, #f472b6); }
.login-account-badge.super { background: linear-gradient(140deg, #7c3aed, #a78bfa); }
.login-account-badge.audit { background: linear-gradient(140deg, #475569, #94a3b8); }
.login-account-info { flex: 1; min-width: 0; }
.login-account-info strong { font-size: 15px; display: block; color: #e2e8f0; font-weight: 600; }
.login-account-info span { font-size: 13px; color: #64748b; }
.login-account-row code {
  font-size: 13px; color: #64748b; background: rgba(255,255,255,0.04);
  padding: 6px 14px; border-radius: 8px; font-family: 'SF Mono', 'Cascadia Code', monospace;
  flex-shrink: 0; border: 1px solid rgba(255,255,255,0.04);
}
.login-account-row:hover code { color: var(--accent); background: var(--accent-light); border-color: rgba(99,102,241,0.1); }

.login-toggle-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 14px 16px; font-size: 14px; color: #4b5563;
  cursor: pointer; background: none; border: none; font-family: var(--font);
  font-weight: 600; transition: color 0.15s;
}
.login-toggle-btn:hover { color: var(--accent); }

.login-footer {
  text-align: center; margin-top: 36px; font-size: 13px; color: #374151;
  letter-spacing: 0.4px; font-weight: 500;
}

/* ─── LOGIN RESPONSIVE ─── */
@media (max-width: 1024px) {
  .login-page { grid-template-columns: 2fr 3fr; }
  .login-sidebar { padding: 44px 36px; }
  .login-sidebar h1 { font-size: 38px; }
  .login-sidebar h1 span:last-child { font-size: 32px; }
  .login-sidebar .tagline { font-size: 14px; }
  .login-features li { font-size: 13px; }
  .login-stat-num { font-size: 28px; }
  .login-main { padding: 40px 48px; }
  .login-card { max-width: 520px; }
  .login-welcome h2 { font-size: 34px; }
}
@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; }
  .login-sidebar { display: none; }
  .login-main { padding: 40px 32px; justify-content: center; }
  .login-card { max-width: 500px; }
}
@media (max-width: 480px) {
  .login-main { padding: 24px 16px; }
  .login-card { max-width: 100%; }
  .login-welcome h2 { font-size: 28px; }
  .login-welcome p { font-size: 14px; }
  .login-welcome { margin-bottom: 24px; }
  .login-field label { font-size: 11px; margin-bottom: 7px; }
  .login-field input { padding: 15px 16px; font-size: 16px; }
  .login-field { margin-bottom: 18px; }
  .login-btn { padding: 17px 20px; font-size: 15px; }
  .login-divider { margin: 24px 0 16px; font-size: 10px; }
  .login-account-row { padding: 11px 12px; gap: 12px; }
  .login-account-badge { width: 36px; height: 36px; font-size: 13px; }
  .login-account-info strong { font-size: 14px; }
  .login-account-info span { font-size: 12px; }
  .login-account-row code { font-size: 12px; padding: 5px 10px; }
  .login-footer { margin-top: 24px; font-size: 12px; }
}

/* ─── OEE GAUGES ─── */
.oee-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.oee-grid .card { padding: 20px 14px; }
@media (max-width: 900px) { .oee-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (max-width: 480px) { .oee-grid { grid-template-columns: 1fr; gap: 10px; } .oee-grid .card { padding: 16px 12px !important; } }

/* ── Monitoring page spacing ── */
.mon-section { margin-bottom: 28px; }
.mon-section-title {
  font-size: 14px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ─── DASHBOARD STAT GRID ─── */
.dash-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 16px; }
.dash-stat-label { font-size: 14px; color: var(--text-muted); margin-bottom: 4px; }
.dash-stat-value { font-size: clamp(22px, 4vw, 38px); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-stat-unit { font-size: 14px; color: var(--text-muted); font-weight: 400; }

/* ─── TAHAP DISTRIBUTION ─── */
.tahap-dist-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.tahap-dist-card { background: var(--bg-tertiary); padding: 12px 18px; border-radius: var(--radius-sm); border: 1px solid var(--border); min-width: min(90px, 100%); flex: 1 1 auto; }
.tahap-dist-count { font-size: clamp(22px, 3vw, 32px); font-weight: 700; color: var(--accent); }
.tahap-dist-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; margin-top: 2px; }

/* ─── PIPELINE VISUALIZATION ─── */
.pipeline-wrap { display: flex; align-items: flex-start; justify-content: center; gap: 0; padding: 12px 0; min-width: max-content; }
.pipeline-step { display: flex; align-items: center; gap: 0; }
.pipeline-node { display: flex; flex-direction: column; align-items: center; min-width: clamp(80px, 10vw, 140px); }
.pipeline-circle { width: clamp(36px, 5vw, 48px); height: clamp(36px, 5vw, 48px); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: clamp(14px, 2vw, 18px); font-weight: 700; color: #fff; }
.pipeline-label { font-size: clamp(11px, 1.5vw, 15px); font-weight: 600; margin-top: 6px; text-align: center; }
.pipeline-detail { font-size: clamp(10px, 1.3vw, 14px); color: var(--text-muted); margin-top: 2px; max-width: clamp(80px, 10vw, 140px); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-connector { flex: 1; height: 3px; min-width: clamp(20px, 3vw, 40px); margin: 0 -4px; margin-bottom: 28px; }

/* ─── BATCH TAHAP PROGRESS ─── */
.tahap-progress { display: flex; gap: 3px; margin-top: 10px; }
.tahap-dot {
  width: 22px; height: 6px; border-radius: 4px; background: rgba(255,255,255,0.06);
  transition: background 0.2s ease;
}
.tahap-dot.done { background: var(--accent-solid); box-shadow: 0 0 6px rgba(99,102,241,0.3); }
.tahap-dot.current { background: var(--warning-solid); animation: pulse 1.5s infinite; box-shadow: 0 0 6px rgba(245,158,11,0.3); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ─── WALLET CARD ─── */
.wallet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.wallet-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; transition: all 0.2s ease; position: relative; overflow: hidden;
}
.wallet-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent-solid), var(--purple-solid));
  opacity: 0.5;
}
.wallet-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.wallet-name { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.wallet-balance { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; }

/* ─── BELL BADGE ─── */
.bell-badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--danger-solid); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px; line-height: 1;
  box-shadow: 0 2px 8px rgba(239,68,68,0.4);
}

/* ─── STAT MINI CARD (dashboard widgets) ─── */
.stat-mini {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: rgba(255,255,255,0.02); border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.stat-mini:hover { background: rgba(255,255,255,0.04); }

/* ─── TAB BAR ─── */
.tab-bar {
  display: flex; gap: 2px; background: var(--bg-tertiary); border-radius: var(--radius-sm);
  padding: 3px; margin-bottom: 20px;
}
.tab-item {
  padding: 8px 18px; border-radius: var(--radius-xs); font-size: 13px; font-weight: 600;
  color: var(--text-muted); background: transparent; border: none;
  cursor: pointer; transition: all 0.2s ease; font-family: var(--font);
}
.tab-item:hover { color: var(--text-secondary); }
.tab-item.active {
  background: var(--bg-card); color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ═══════════════════════════════════════════════════
   GLASSMORPHISM DASHBOARD — Quantix-style
   ═══════════════════════════════════════════════════ */

/* ── Main gradient background with radial blobs ── */
.main-gradient {
  background:
    radial-gradient(ellipse at 15% 10%, rgba(99,102,241,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 20%, rgba(139,92,246,0.07) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 80%, rgba(99,102,241,0.05) 0%, transparent 50%),
    linear-gradient(168deg, #0a0a14 0%, #06060b 40%, #0d0b1a 100%);
  background-attachment: fixed;
}

/* ── Welcome Header ── */
.dash-welcome {
  margin-bottom: 28px;
  padding: 32px 0 8px;
}
.dash-welcome h1 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #f1f5f9 0%, #c7d2fe 60%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.dash-welcome p {
  font-size: 15px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-welcome p svg {
  width: 14px; height: 14px; opacity: 0.5;
}

/* ── Ticker Strip ── */
.dash-ticker {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dash-ticker::-webkit-scrollbar { display: none; }
.dash-ticker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,0.04);
  flex: 1 0 auto;
  min-width: 0;
}
.dash-ticker-item:last-child { border-right: none; }
.dash-ticker-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dash-ticker-icon svg { width: 16px; height: 16px; }
.dash-ticker-label {
  font-size: 11px; color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.dash-ticker-value {
  font-size: 16px; font-weight: 700; color: var(--text);
  letter-spacing: -0.02em;
}

/* ── Glass Card Base ── */
.glass-card {
  background: rgba(255,255,255,0.035);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
}
.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%);
  pointer-events: none;
}
.glass-card:hover {
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 8px 40px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.04);
  transform: translateY(-2px);
}

.glass-card .card-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: transparent;
}
.glass-card .card-body {
  padding: 24px;
}
.glass-card .card-body.flush {
  padding: 0;
}

/* ── Glass Metric Card ── */
.glass-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.glass-metric {
  background: rgba(255,255,255,0.035);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.glass-metric::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.10) 50%, transparent 100%);
  pointer-events: none;
}
.glass-metric::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 120px; height: 80px;
  border-radius: 50% 0 0 0;
  opacity: 0.06;
  pointer-events: none;
}
.glass-metric:nth-child(1)::after { background: radial-gradient(ellipse at 100% 100%, var(--accent-solid), transparent 70%); }
.glass-metric:nth-child(2)::after { background: radial-gradient(ellipse at 100% 100%, var(--purple-solid), transparent 70%); }
.glass-metric:nth-child(3)::after { background: radial-gradient(ellipse at 100% 100%, var(--success-solid), transparent 70%); }
.glass-metric:nth-child(4)::after { background: radial-gradient(ellipse at 100% 100%, var(--warning-solid), transparent 70%); }
.glass-metric:nth-child(5)::after { background: radial-gradient(ellipse at 100% 100%, var(--info-solid), transparent 70%); }

.glass-metric:hover {
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  transform: translateY(-3px);
}

.glass-metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.glass-metric-icon {
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.glass-metric-icon svg { width: 22px; height: 22px; }

.metric-value {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metric-value-sm {
  font-size: clamp(18px, 2.5vw, 26px);
}
.metric-label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}
.metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.metric-trend.up {
  background: rgba(16,185,129,0.12);
  color: var(--success);
}
.metric-trend.down {
  background: rgba(239,68,68,0.12);
  color: var(--danger);
}
.metric-trend.neutral {
  background: rgba(107,114,128,0.12);
  color: var(--text-muted);
}
.metric-trend svg { width: 12px; height: 12px; }

/* Sparkline decoration bar */
.metric-sparkline {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40px;
  opacity: 0.15;
  pointer-events: none;
}

/* ── Live Updates Header ── */
.live-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.live-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}
.live-header .subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Glass Table Rows ── */
.glass-card .table tbody tr:nth-child(even) td {
  background: rgba(255,255,255,0.015);
}
.glass-card .table tbody tr:hover td {
  background: rgba(99, 102, 241, 0.06);
}

/* ── Quick Actions Grid ── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: rgba(255,255,255,0.035);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.quick-action::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.10) 50%, transparent 100%);
  pointer-events: none;
}
.quick-action:hover {
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}
.quick-action-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.quick-action-icon svg { width: 22px; height: 22px; }
.quick-action-text { min-width: 0; }
.quick-action-label {
  font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.quick-action-hint {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Clickable glass-metric */
a.glass-metric {
  text-decoration: none;
  color: inherit;
  display: block;
}
a.glass-metric:hover {
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 8px 40px rgba(0,0,0,0.3), 0 0 0 1px rgba(99,102,241,0.15);
  transform: translateY(-3px);
}

/* ── Section Header ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.section-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-header .section-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}
.section-header .section-link:hover {
  color: var(--text);
}

/* ── Gudang Grid ── */
.gudang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

/* ── Dashboard Responsive ── */

@media (max-width: 1440px) {
  .main { padding: 20px 22px; }
  .kpi-grid { gap: 10px; }
  .kpi-card { padding: 18px; min-height: 110px; }
  .kpi-value { font-size: 26px; }
  .kpi-label { font-size: 13px; }
  .quick-actions { gap: 10px; }
  .quick-action { padding: 14px 16px; gap: 10px; }
  .quick-action-icon { width: 38px; height: 38px; }
  .quick-action-icon svg { width: 18px; height: 18px; }
  .quick-action-label { font-size: 13px; }
  .quick-action-hint { font-size: 11px; }
  .glass-metrics-grid { gap: 12px; }
  .glass-metric { padding: 18px; border-radius: 16px; }
  .metric-value { font-size: 26px; }
  .metric-label { font-size: 13px; }
  .glass-metric-icon { width: 38px; height: 38px; }
  .glass-metric-icon svg { width: 18px; height: 18px; }
  .section-header h2 { font-size: 16px; }
  .card-header h3 { font-size: 15px; }
  .table th { padding: 10px 16px; font-size: 11px; }
  .table td { padding: 12px 16px; font-size: 14px; }
  .gudang-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
}

@media (max-width: 1280px) {
  .glass-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .metric-value { font-size: 26px; }
  .glass-metric { padding: 20px; }
}

@media (max-width: 768px) {
  .quick-actions { grid-template-columns: 1fr 1fr; gap: 8px; }
  .quick-action { padding: 12px 14px; gap: 10px; border-radius: 12px; }
  .quick-action-icon { width: 34px; height: 34px; border-radius: 10px; }
  .quick-action-icon svg { width: 16px; height: 16px; }
  .quick-action-label { font-size: 12px; }
  .quick-action-hint { font-size: 10px; }
  .gudang-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .dash-welcome { padding: 16px 0 4px; margin-bottom: 20px; }
  .dash-welcome h1 { font-size: 24px; }
  .glass-metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .glass-metric {
    padding: 16px;
    border-radius: 14px;
  }
  .glass-metric-icon { width: 36px; height: 36px; border-radius: 10px; }
  .glass-metric-icon svg { width: 18px; height: 18px; }
  .metric-value { font-size: 22px; }
  .metric-label { font-size: 12px; }
  .glass-card { border-radius: 14px; }
  .glass-card .card-header { padding: 14px 16px; }
  .glass-card .card-body { padding: 16px; }
  .dash-ticker-item { padding: 10px 14px; }
  .dash-ticker-value { font-size: 14px; }
  .live-header { padding: 14px 16px; }
}

@media (max-width: 480px) {
  .quick-actions { grid-template-columns: 1fr; gap: 8px; }
  .quick-action { padding: 12px 14px; border-radius: 10px; }
  .gudang-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .glass-metrics-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .glass-metric {
    flex-direction: row;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
  }
  .glass-metric-header { margin-bottom: 0; }
  .glass-metric-body { flex: 1; }
  .metric-value { font-size: 20px; margin-bottom: 2px; }
  .metric-label { font-size: 12px; }
  .dash-welcome h1 { font-size: 22px; }
  .dash-ticker { border-radius: 10px; }
  .glass-card { border-radius: 12px; }
}
