/* ==========================================================================
   Clicker Product Configurator - Clean Modern Light Theme
   Matches the Kasir 3D Print POS System aesthetic (clean, crisp, elegant)
   ========================================================================== */

:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-sub: #f8fafc;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-subtle: #edf2f7;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sub: #94a3b8;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --accent: #059669;
  --accent-soft: #ecfdf5;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.05);

  /* ==========================================================================
     Standardized Fluid & Responsive Typography Scale (Design Tokens)
     Berpedoman pada Apple HIG & Google Material Design 3 via CSS clamp()
     Font otomatis beradaptasi mulus mengikuti lebar layout (Fluid Typography)
     ========================================================================== */
  --font-2xs: clamp(9.5px, 0.60rem + 0.2vw, 10.5px);   /* Micro, Pill, Sub-badge, KPI labels */
  --font-xs:  clamp(10.5px, 0.66rem + 0.25vw, 11.5px); /* Table data, Captions, Timestamp */
  --font-sm:  clamp(11.5px, 0.72rem + 0.25vw, 12.5px); /* Table Header, Helper text, Pills */
  --font-base:clamp(12.5px, 0.78rem + 0.3vw, 13.5px);  /* Body Text, Normal Button, Nav Tab */
  --font-md:  clamp(13.5px, 0.85rem + 0.35vw, 15px);   /* Form Input, Dropdown, Subtitle */
  --font-lg:  clamp(15px, 0.95rem + 0.45vw, 17px);     /* Card Title, Section Heading */
  --font-xl:  clamp(17px, 1.10rem + 0.6vw, 20px);      /* Page Title, Modal Title */
  --font-2xl: clamp(20px, 1.30rem + 0.8vw, 24px);      /* Grand Total, Main Hero Title */
  --font-display: clamp(24px, 1.60rem + 1.2vw, 32px);  /* Large Metric Count */
}

/* ==========================================================================
   Unified UI Vector Icons (Lucide Outline Style)
   ========================================================================== */
.ui-icon {
  display: inline-block;
  vertical-align: -0.15em;
  width: 1em;
  height: 1em;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  transition: transform 0.15s ease, stroke 0.15s ease;
}

.ui-icon-xs { width: 12px; height: 12px; }
.ui-icon-sm { width: 14px; height: 14px; }
.ui-icon-md { width: 16px; height: 16px; }
.ui-icon-lg { width: 18px; height: 18px; }
.ui-icon-xl { width: 22px; height: 22px; }

.btn .ui-icon,
button .ui-icon {
  vertical-align: -0.18em;
}

.btn .ui-icon:first-child:not(:last-child),
button .ui-icon:first-child:not(:last-child) {
  margin-right: 6px;
}

.btn .ui-icon:last-child:not(:first-child),
button .ui-icon:last-child:not(:first-child) {
  margin-left: 6px;
}

.btn-icon-only .ui-icon,
.btn-icon .ui-icon {
  margin: 0 !important;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html, body {
  max-width: 100vw;
  overflow-x: clip;
  width: 100%;
  position: relative;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 60px;
  line-height: 1.5;
}

/* ==========================================================================
   APP LAYOUT & MODERN LEFT SIDEBAR NAVIGATION (GROUPED MENUS)
   ========================================================================== */

/* Main App Wrapper */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: var(--bg-body, #f8fafc);
  position: relative;
}

/* App Sidebar (Left Navigation) */
.app-sidebar {
  width: 260px;
  min-width: 260px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100vh;
  z-index: 100;
  box-shadow: 1px 0 3px rgba(0, 0, 0, 0.02);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
  padding: 16px 18px 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.sidebar-brand .brand-title {
  font-size: 14.5px;
  font-weight: 750;
  color: #0f172a;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.sidebar-brand .brand-sub {
  font-size: 10.5px;
  color: #64748b;
  font-weight: 500;
  line-height: 1.2;
}

.sidebar-close-btn {
  display: none; /* Only shown on mobile drawer */
  background: transparent;
  border: none;
  font-size: 18px;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.sidebar-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Sidebar Navigation Scroll Area */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 10px 32px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.2s ease;
}
.sidebar-nav:hover {
  scrollbar-color: #cbd5e1 transparent;
}
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
}
.sidebar-nav:hover::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}

/* Navigation Groups */
.nav-group {
  margin-bottom: 2px;
}

.nav-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 8px 10px 4px 10px;
  cursor: pointer;
  user-select: none;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.nav-group-title:hover {
  color: #475569;
  background: rgba(241, 245, 249, 0.6);
}

.nav-group-chevron {
  font-size: 10px;
  line-height: 1;
  color: #94a3b8;
  transition: transform 0.2s ease;
  display: inline-block;
}

/* Collapsed Group State */
.nav-group.collapsed .nav-group-items {
  display: none;
}
.nav-group.collapsed .nav-group-chevron {
  transform: rotate(-90deg);
}

/* Navigation Items (Clean Outline Pill Style) */
.sidebar-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 6.5px 10px;
  border-radius: 6px;
  background: transparent;
  border: none;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  position: relative;
  text-decoration: none;
}

.sidebar-nav-item svg.nav-icon {
  width: 15px;
  height: 15px;
  stroke: #64748b;
  flex-shrink: 0;
  transition: stroke 0.15s ease;
}

.sidebar-nav-item:hover {
  background: #f8fafc;
  color: #0f172a;
}
.sidebar-nav-item:hover svg.nav-icon {
  stroke: #334155;
}

/* Active State (Exact match with Gambar 1: soft blue background, blue text & icon) */
.sidebar-nav-item.active {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-weight: 700 !important;
}
.sidebar-nav-item.active svg.nav-icon {
  stroke: #2563eb !important;
}

.sidebar-nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Group Dividers */
.sidebar-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 4px 6px;
}

/* Badges on Navigation Items */
.nav-badge-pill {
  font-size: 10.5px;
  font-weight: 750;
  padding: 2px 7px;
  border-radius: 12px;
  background: #e2e8f0;
  color: #475569;
  line-height: 1.2;
}
.sidebar-nav-item .nav-badge-pill {
  margin-left: auto;
  flex-shrink: 0;
}
.nav-badge-pill.badge-emerald {
  background: #10b981 !important;
  color: #ffffff !important;
}
.nav-badge-pill.badge-amber {
  background: #f59e0b !important;
  color: #ffffff !important;
}

/* Sidebar User Profile & Actions Footer (Tersembunyi di Desktop, Ditampilkan di Drawer Samping Mobile) */
.sidebar-user-footer {
  display: none !important;
}
@media (max-width: 1023px) {
  .sidebar-user-footer {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    flex-shrink: 0;
    gap: 8px;
  }
}
.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.sidebar-user-meta {
  min-width: 0;
  flex: 1;
}
.sidebar-user-name {
  font-size: 12.5px;
  font-weight: 750;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  margin-bottom: 2px;
}
.sidebar-user-role-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1.5px 6px;
  border-radius: 6px;
  letter-spacing: 0.03em;
  background: #e2e8f0;
  color: #475569;
  border: 1px solid transparent;
  display: inline-block;
  line-height: 1.2;
}
.sidebar-user-role-badge.role-owner {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.sidebar-user-role-badge.role-kasir {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}
.sidebar-user-role-badge.role-operator {
  background: #f3e8ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}
.sidebar-user-role-badge.role-monitor {
  background: #ccfbf1;
  color: #0f766e;
  border-color: #99f6e4;
}
.sidebar-user-role-badge.role-viewer {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}
.sidebar-user-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.btn-sidebar-reorder,
.btn-sidebar-logout {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  transition: all 0.15s ease;
}
.btn-sidebar-reorder:hover {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}
.btn-sidebar-logout:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
}

/* Main Content Area (Right of Sidebar) */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  margin-left: 260px;
  width: calc(100% - 260px);
}

/* Sticky Top Header */
.top-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.top-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-sidebar-toggle {
  display: none; /* Shown on mobile screens */
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.btn-sidebar-toggle:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.current-page-badge {
  display: none !important; /* Disembunyikan agar tidak dobel/duplikat dengan judul halaman di dalam kartu */
}

.top-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Environment Switcher Toolbar */
.header-env-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-env-switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid #f59e0b;
  background: #fffbeb;
  color: #b45309;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-env-switch:hover {
  background: #fef3c7;
  border-color: #d97706;
}

/* Vertical Divider in Top Header */
.header-divider-v {
  width: 1px;
  height: 20px;
  background: #e2e8f0;
  margin: 0 2px;
}

/* User Profile Container */
.header-user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* User Card Pill */
.header-user-card {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 10px 0 5px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  user-select: none;
}

.header-user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
}

.header-user-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.header-user-name {
  font-size: 12px;
  font-weight: 750;
  color: #0f172a;
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-user-role-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2.5px 6.5px;
  border-radius: 10px;
  letter-spacing: 0.03em;
  background: #e2e8f0;
  color: #475569;
  border: 1px solid transparent;
}

.header-user-role-badge.role-owner {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.header-user-role-badge.role-kasir {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}
.header-user-role-badge.role-operator {
  background: #f3e8ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}
.header-user-role-badge.role-monitor {
  background: #ccfbf1;
  color: #0f766e;
  border-color: #99f6e4;
}
.header-user-role-badge.role-viewer {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

/* Header Action Buttons (Atur Menu, Keluar) */
.btn-header-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-header-action.btn-menu-settings {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.btn-header-action.btn-menu-settings:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-header-action.btn-logout {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}
.btn-header-action.btn-logout:hover {
  background: #fee2e2;
  border-color: #f87171;
  color: #991b1b;
}

/* Backwards compatibility for existing nav-tab selectors */
.nav-tab {
  cursor: pointer;
}

/* Mobile Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Responsive Rules for Left Sidebar */
@media (max-width: 1023px) {
  .btn-sidebar-toggle {
    display: inline-flex;
  }
  .sidebar-close-btn {
    display: block;
  }
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    box-shadow: 6px 0 28px rgba(0, 0, 0, 0.18);
  }
  .app-sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .top-header {
    padding: 10px 14px;
  }
}

/* Main Container - Standarisasi Lebar Universal 1380px Sesuai Standar Sistem (BAB L & M / src) */
.container {
  width: 100% !important;
  max-width: 1380px !important;
  margin: 0 auto !important;
  padding: 24px 32px !important;
  box-sizing: border-box !important;
}

.tab-content {
  display: none;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.tab-content.active {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
}

/* Packaging 3-Col Grid & Cards (Responsive Mobile 1-Col, Desktop 3-Col) */
.packaging-3col-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.packaging-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 860px) {
  .packaging-3col-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

/* Configurator Layout - Preview di atas, Card Input di bawah agar lega */
.configurator-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100% !important;
}

/* Card - Lebar Seragam Penuh */
.card {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.card-title {
  font-size: var(--font-lg);
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge-subtle {
  font-size: var(--font-2xs);
  padding: 3px 9px;
  background: #f1f5f9;
  color: #475569;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

/* Preview Stage */
.preview-stage {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 44px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 360px;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.04);
}

.preview-hint {
  position: absolute;
  top: 14px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

/* Keychain Assembly */
.keychain-assembly {
  display: flex;
  align-items: center;
  gap: 10px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.15));
  transition: transform 0.2s ease;
  user-select: none;
}

/* Metal Chain Attachment */
.chain-attachment {
  display: flex;
  align-items: center;
}

.metal-ring {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 5.5px solid #94a3b8;
  background: radial-gradient(circle, transparent 58%, #64748b 95%, #475569 100%);
  box-shadow: 
    inset 0 2px 4px rgba(255, 255, 255, 0.95), 
    inset 0 -2px 4px rgba(15, 23, 42, 0.7), 
    0 4px 8px rgba(0, 0, 0, 0.22);
}

.metal-links {
  display: flex;
  margin-left: -6px;
}

.metal-link {
  width: 14px;
  height: 8px;
  border-radius: 4px;
  border: 2px solid #cbd5e1;
  background: linear-gradient(180deg, #e2e8f0 0%, #94a3b8 100%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 2px 4px rgba(0,0,0,0.18);
  margin-left: -3px;
}

/* Base Body */
.keychain-base {
  background: var(--base-color, #ffffff);
  border-radius: 14px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 
    0 12px 24px -4px rgba(15, 23, 42, 0.22),
    0 4px 8px -2px rgba(15, 23, 42, 0.1),
    inset 0 2px 3px rgba(255, 255, 255, 0.85),
    inset 0 -3px 5px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.14);
  position: relative;
  transition: background 0.2s ease;
}

.keychain-base-hole {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cbd5e1;
  box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, 0.45);
  margin-right: 2px;
}

/* Keycap Slot */
.clicker-slot {
  width: 50px;
  height: 50px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.switch-housing {
  position: absolute;
  width: 40px;
  height: 40px;
  background: #f1f5f9;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.switch-stem {
  width: 12px;
  height: 12px;
  background: #0284c7;
  border-radius: 2px;
}

/* Keycap Item */
.keycap-item {
  width: 46px;
  height: 46px;
  background: var(--keycap-bg, #FFBAC3);
  color: var(--keycap-text, #ffffff);
  border-radius: 9px;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 6px 0 rgba(0, 0, 0, 0.22),
    0 10px 14px rgba(15, 23, 42, 0.16),
    inset 0 2px 3px rgba(255, 255, 255, 0.65),
    inset 0 -2px 3px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(0, 0, 0, 0.12);
  transition: transform 0.08s cubic-bezier(0.2, 0.8, 0.4, 1), box-shadow 0.08s cubic-bezier(0.2, 0.8, 0.4, 1);
  user-select: none;
  font-weight: 800;
  letter-spacing: -0.5px;
  overflow: hidden;
  box-sizing: border-box;
  padding: 2px;
}

.keycap-item:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 0 rgba(0, 0, 0, 0.22),
    0 14px 18px rgba(15, 23, 42, 0.2),
    inset 0 2px 3px rgba(255, 255, 255, 0.75),
    inset 0 -2px 3px rgba(0, 0, 0, 0.22);
}

.keycap-item.pressed {
  transform: translateY(5px) !important;
  box-shadow: 
    0 1px 0 rgba(0, 0, 0, 0.22),
    0 3px 6px rgba(15, 23, 42, 0.15),
    inset 0 2px 4px rgba(0, 0, 0, 0.35) !important;
}

/* Font Styles */
.keycap-item.font-arial {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 19px;
  font-weight: 700;
}

.keycap-item.font-pokemon {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.keycap-item.is-icon {
  font-size: 20px;
}

/* Vertical Keycap Orientation (Rotasi 90 Derajat untuk Gantungan Tegak) */
.keycap-item.is-vertical-orientation .keycap-text-label,
.keycap-item.is-vertical-orientation .keycap-graphic-wrapper,
.keycap-item.is-vertical-orientation .keycap-emoji-icon {
  transform: rotate(-90deg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Keycap Content Elements */
.keycap-graphic-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: 7px;
  box-sizing: border-box;
  pointer-events: none;
}

.keycap-graphic-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 7px;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.18));
}

.keycap-graphic-fallback {
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.keycap-emoji-icon {
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.keycap-text-label {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
  text-align: center;
  padding: 0 2px;
  box-sizing: border-box;
  pointer-events: none;
}

.keycap-empty-plus {
  font-size: 16px;
  font-weight: 700;
  color: #94a3b8;
  pointer-events: none;
}

/* Controls Form */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12px !important;
  font-weight: 750 !important;
  color: #334155 !important;
  margin-bottom: 6px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  line-height: 1.2 !important;
}

/* Slot Pills */
.slot-pills {
  display: flex;
  gap: 6px;
}

.slot-pill {
  flex: 1;
  padding: 8px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #64748b;
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.slot-pill:hover {
  border-color: #cbd5e1;
  color: var(--text-main);
}

.slot-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

/* Standarisasi Form Controls (Tinggi Seragam 40px) */
.color-picker-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  height: 40px !important;
  min-height: 40px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.color-swatch-circle {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  border-radius: 50% !important;
  border: 2px solid #cbd5e1 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15) !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

.select-custom,
input.select-custom,
input[type="text"].select-custom,
input[type="number"].select-custom {
  width: 100% !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  box-sizing: border-box !important;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  padding: 0 12px !important;
  border-radius: 8px !important;
  font-size: 13.5px !important;
  outline: none;
  cursor: pointer;
  line-height: normal !important;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.custom-color-select-trigger {
  width: 100% !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  box-sizing: border-box !important;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  padding: 0 12px !important;
  border-radius: 8px !important;
  font-size: 13.5px !important;
  outline: none;
  cursor: pointer;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  line-height: normal !important;
  transition: border-color 0.15s, box-shadow 0.15s;
}

/* Pastikan select yang di-hide oleh script kustom dropdown tidak muncul ganda */
select.select-custom[style*="display: none"],
select.select-custom[style*="display:none"],
.select-custom.hidden,
.select-custom[hidden] {
  display: none !important;
}

/* Standarisasi Button Group Selector Berdampingan Input (Solusi Gambar 1) */
#opnameBaseTypeTabsBar,
#baseTypeTabsBar,
#customizerBaseTypeTabsBar {
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  padding: 3px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: stretch !important;
  gap: 4px !important;
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  width: 100% !important;
  margin-bottom: 0 !important;
}

#opnameBaseTypeTabsBar .sub-tab-btn,
#baseTypeTabsBar .sub-tab-btn,
#customizerBaseTypeTabsBar .sub-tab-btn {
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 0 8px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1 1 0 !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}

#opnameBaseTypeTabsBar .sub-tab-btn.active,
#baseTypeTabsBar .sub-tab-btn.active,
#customizerBaseTypeTabsBar .sub-tab-btn.active {
  background: var(--primary, #2563eb) !important;
  color: #ffffff !important;
  font-weight: 750 !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25) !important;
  border-color: var(--primary, #2563eb) !important;
}

#opnameBaseTypeTabsBar .sub-tab-btn:not(.active),
#baseTypeTabsBar .sub-tab-btn:not(.active),
#customizerBaseTypeTabsBar .sub-tab-btn:not(.active) {
  background: #ffffff !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}

.select-custom:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.select-custom:has(option[value=""]:checked),
.select-custom.is-placeholder {
  color: #64748b !important;
  font-style: italic !important;
}

.select-custom option {
  color: #0f172a;
  font-style: normal;
  font-weight: 500;
}

.select-custom option[value=""] {
  color: #64748b;
  font-style: italic;
}

/* Font Toggle Selector */
.font-toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Customizer Radio Card Group (Font & Orientasi) */
.cust-radio-card-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.cust-radio-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  box-sizing: border-box;
}

.cust-radio-card:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.cust-radio-card .cust-radio-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Lingkaran Radio Bulat */
.cust-radio-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #94a3b8;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

/* State Aktif Terpilih (Sangat Tegas & Jelas) */
.cust-radio-card.active,
.cust-radio-card:has(.cust-radio-input:checked) {
  border-color: #2563eb !important;
  background: #eff6ff !important;
  box-shadow: 0 0 0 1px #2563eb, 0 2px 6px rgba(37, 99, 235, 0.15) !important;
}

.cust-radio-card.active .cust-radio-circle,
.cust-radio-card:has(.cust-radio-input:checked) .cust-radio-circle {
  border-color: #2563eb !important;
  background: #ffffff !important;
}

.cust-radio-card.active .cust-radio-circle::after,
.cust-radio-card:has(.cust-radio-input:checked) .cust-radio-circle::after {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2563eb;
  display: block;
}

.cust-radio-content {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.cust-radio-preview-font {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #f1f5f9;
  border-radius: 6px;
  color: #1e293b;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.cust-radio-card.active .cust-radio-preview-font {
  background: #dbeafe;
  color: #1d4ed8;
}

.cust-radio-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cust-radio-title {
  font-size: 13px;
  font-weight: 750;
  color: #1e293b;
  line-height: 1.2;
}

.cust-radio-card.active .cust-radio-title {
  color: #1d4ed8;
}

.cust-radio-subtitle {
  font-size: 11px;
  color: #64748b;
  line-height: 1.2;
  margin-top: 2px;
}

/* Fallback legacy font-option-btn if referenced elsewhere */
.font-option-btn {
  padding: 9px 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  color: #475569;
  font-size: var(--font-base);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
}

.font-option-btn:hover {
  border-color: #94a3b8;
  color: var(--text-main);
}

.font-option-btn.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.15);
}

/* Pricing Card */
.price-breakdown {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 18px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
}

.price-row.total {
  border-top: 1px dashed var(--border-color);
  padding-top: 10px;
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.price-row.total .highlight {
  color: var(--accent);
  font-size: 18px;
}

.profit-pill {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid #a7f3d0;
  padding: 3px 8px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
}

/* Styling Sistem Harga Paket (Bundling Price List), Komponen Include & Reseller */
.text-include {
  color: #15803d !important;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
}

.text-free {
  color: #047857 !important;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 750;
  display: inline-block;
}

.tier-pill-btn {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tier-pill-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.tier-pill-btn.active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.btn-strap-pkg {
  transition: all 0.15s ease;
}

.btn-strap-pkg:hover {
  border-color: #94a3b8;
}

.btn-strap-pkg.active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.status-bar {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

/* Standard Enterprise Table Styles (docs/UI_AND_CODING_STANDARDS.md Sections 7 & 9) */
.table-responsive {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.custom-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: var(--font-xs);
  text-align: left;
}

.custom-table thead tr {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #64748b;
  font-size: var(--font-2xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.custom-table th {
  padding: 8px 10px;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
  white-space: normal !important;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.3;
  font-size: var(--font-sm);
}

.custom-table th.th-center {
  text-align: center;
  font-weight: 700;
  color: #0f172a;
}

.custom-table th.th-money {
  text-align: right;
  font-weight: 700;
  color: #0f172a;
}

.custom-table tbody tr {
  transition: background-color 0.12s ease;
}

.custom-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  font-size: var(--font-xs);
  vertical-align: middle;
}

.custom-table td.td-center {
  text-align: center;
  font-weight: 700;
  color: #0f172a;
}

.custom-table td.td-money {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #059669;
  white-space: nowrap;
}

.custom-table code {
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.custom-table tbody tr:last-child td {
  border-bottom: none;
}

.custom-table tbody tr:hover td {
  background: #f8fafc;
}

/* Standard ERP Table Pagination (docs/UI_AND_CODING_STANDARDS.md Section 8) */
.table-erp-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
  color: #64748b;
  flex-wrap: wrap;
  gap: 10px;
}

.table-erp-pagination select {
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 11.5px;
  color: #0f172a;
  cursor: pointer;
  outline: none;
  font-weight: 500;
}

.table-erp-pagination select:focus {
  border-color: var(--primary);
}

.table-erp-pagination button {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.table-erp-pagination button:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.table-erp-pagination button:disabled {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #cbd5e1;
  cursor: not-allowed;
}

.table-erp-pagination .page-indicator {
  font-size: 11.5px;
  font-weight: 600;
  padding: 0 4px;
  color: #0f172a;
}

.color-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.color-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* Form Grid */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Buttons */
.btn-submit {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.btn-submit:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-submit:disabled {
  background: #94a3b8;
  color: #f1f5f9;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-action {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-action:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Alerts */
.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   Batch Production Matrix Styles (Clean Light Design)
   ========================================================================== */

.batch-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.batch-char-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  text-align: center;
  transition: all 0.15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.batch-char-card:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
  background: #ffffff;
}

.batch-char-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 5px;
}

.batch-char-input {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  padding: 4px 0;
  outline: none;
  transition: all 0.12s;
}

.batch-char-input:focus {
  border-color: var(--primary);
  background: #ffffff;
}

/* 7-Card Grid Responsif (Maksimal 7 Card per Baris) */
.batch-grid-7 {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

@media (max-width: 800px) {
  .batch-grid-7 {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
    gap: 6px !important;
  }
}

.batch-char-input-group {
  display: flex;
  align-items: stretch;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.batch-char-input-group:focus-within {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
}

.batch-char-input-group .batch-char-input {
  border: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  width: 100% !important;
  flex: 1 1 auto !important;
  padding: 5px 2px !important;
  font-size: 15px !important;
  font-weight: 750 !important;
  text-align: center !important;
  min-width: 0 !important;
}

.batch-char-stepper-wrap {
  display: flex;
  flex-direction: column;
  border-left: 1px solid #cbd5e1;
  width: 24px;
  flex-shrink: 0;
}

.batch-char-stepper-btn {
  flex: 1;
  border: none;
  background: #f8fafc;
  color: #475569;
  font-size: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  user-select: none;
  transition: background-color 0.1s, color 0.1s;
}

.batch-char-stepper-btn.btn-step-up {
  border-bottom: 1px solid #cbd5e1;
}

.batch-char-stepper-btn:hover {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}

.batch-char-stepper-btn:active {
  background: #dbeafe !important;
}

/* Hide native arrows inside batch input when using custom steppers */
.batch-char-input-group .batch-char-input::-webkit-outer-spin-button,
.batch-char-input-group .batch-char-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.batch-char-input-group .batch-char-input {
  -moz-appearance: textfield;
}


.batch-char-input::placeholder,
.select-custom::placeholder,
.opname-qty-input::placeholder,
.clean-input::placeholder,
.clean-input-time::placeholder,
.num-input::placeholder,
input[type="number"]::placeholder,
input[inputmode="numeric"]::placeholder,
input[inputmode="decimal"]::placeholder {
  color: #94a3b8;
  font-weight: 500;
  opacity: 1;
}

/* Hide arrow spinners on number input */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button,
.batch-char-input::-webkit-outer-spin-button,
.batch-char-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"],
.batch-char-input[type=number] {
  -moz-appearance: textfield;
}

/* Universal Numeric & Quantity Input Centering */
input[type="number"],
input[inputmode="numeric"],
input[inputmode="decimal"],
.clean-input,
.clean-input-time,
.num-input,
.batch-char-input,
.opname-qty-input {
  text-align: center !important;
}

/* ==========================================================================
   UNIFIED TAB DESIGN SYSTEM (Desktop & Mobile-First Standard)
   ========================================================================== */
.sub-tabs-bar,
.batch-nav-group,
.opname-subtabs-bar {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: nowrap;
  align-items: stretch;
}

.sub-tab-btn,
.batch-nav-btn,
.batch-mode-btn,
.opname-nav-btn,
.inbound-parts-nav-btn,
.inv-filter-btn {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  word-break: normal;
  line-height: 1.25;
  min-height: 44px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid var(--border-color, #e2e8f0);
  color: #475569;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.sub-tab-btn:hover,
.batch-nav-btn:hover,
.batch-mode-btn:hover,
.opname-nav-btn:hover,
.inbound-parts-nav-btn:hover,
.inv-filter-btn:hover {
  background: #f8fafc;
  color: var(--text-main, #0f172a);
  border-color: #cbd5e1;
}

.sub-tab-btn.active,
.batch-nav-btn.active,
.batch-mode-btn.active,
.opname-nav-btn.active,
.inbound-parts-nav-btn.active,
.inv-filter-btn.active {
  background: var(--primary, #4f46e5) !important;
  border-color: var(--primary, #4f46e5) !important;
  color: #ffffff !important;
  font-weight: 750 !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.28) !important;
}

.sub-tab-btn.active span,
.batch-nav-btn.active span,
.batch-mode-btn.active span,
.opname-nav-btn.active span,
.inbound-parts-nav-btn.active span,
.inv-filter-btn.active span {
  color: #ffffff !important;
}

/* Batch Summary Bar */
.batch-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 20px;
  margin-top: 18px;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.summary-metrics-group {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.summary-metric-divider {
  width: 1px;
  height: 32px;
  background: #cbd5e1;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .summary-metric-divider {
    display: none !important;
  }
}

.summary-metric {
  display: flex;
  flex-direction: column;
}

.summary-metric .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.summary-metric .val {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.summary-metric .val.highlight {
  color: var(--accent);
}

/* Stock Badges */
.stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}



/* ==========================================================================
   Custom Color Select Dropdown with Live Color Dot Previews
   ========================================================================== */
.custom-color-select-wrap {
  position: relative;
  width: 100%;
  user-select: none;
}

.custom-color-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: #0f172a;
  transition: all 0.15s ease;
  min-height: 38px;
  box-sizing: border-box;
}

.custom-color-select-trigger:hover {
  border-color: #94a3b8;
}

.custom-color-select-wrap.open .custom-color-select-trigger {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3.5px rgba(99, 102, 241, 0.15) !important;
}

.custom-color-trigger-content {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  flex: 1;
}

.custom-color-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.custom-color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  display: inline-block;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.custom-color-arrow {
  font-size: 9px;
  color: #64748b;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-left: 8px;
  flex-shrink: 0;
}

.custom-color-select-wrap.open .custom-color-arrow {
  transform: rotate(180deg);
  color: #6366f1;
}

.custom-color-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.14), 0 4px 10px -2px rgba(15, 23, 42, 0.06);
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000 !important;
  display: none;
  padding: 4px 0;
}

.custom-dropdown-optgroup-label {
  font-size: 11px;
  font-weight: 750;
  color: #64748b;
  padding: 6px 12px;
  text-transform: uppercase;
  background: #f8fafc;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #f1f5f9;
  border-top: 1px solid #f1f5f9;
}

.custom-color-select-wrap.open .custom-color-menu {
  display: block;
}

.custom-color-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: #1e293b;
  cursor: pointer;
  transition: background 0.1s;
  font-weight: 500;
}

.custom-color-menu-item:hover {
  background: #f8fafc;
}

.custom-color-menu-item.selected {
  background: #eef2ff !important;
  font-weight: 750 !important;
  color: #4338ca !important;
}

.ready-chip-sm {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 750;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  margin-left: auto;
  letter-spacing: 0.2px;
}

/* Customizer Slot Table */
.cust-slot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.cust-slot-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.cust-slot-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.cust-slot-table tr:hover td {
  background-color: #f8fafc;
}

.cust-slot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: #eff6ff;
  color: #2563eb;
  font-weight: 700;
  border-radius: 6px;
  font-size: 11.5px;
  border: 1px solid #bfdbfe;
}

.cust-slot-color-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
}

.cust-slot-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.cust-slot-fixed-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #334155;
  font-weight: 500;
  width: 100%;
  box-sizing: border-box;
}

/* Custom Color Select in Slot Table */
.cust-slot-table td {
  position: relative;
}

.cust-slot-table tr.has-open-dropdown {
  position: relative;
  z-index: 100;
}

.cust-slot-table .cust-slot-dropdown-wrap {
  position: relative;
  width: 100%;
}

.cust-slot-table .custom-color-select-wrap {
  width: 100%;
}

.cust-slot-table .custom-color-select-wrap.open {
  z-index: 150;
}

.cust-slot-table .custom-color-select-trigger {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  min-height: 32px;
}

.cust-slot-table .custom-color-trigger-content {
  gap: 8px;
}

.cust-slot-table .custom-color-dot {
  width: 14px;
  height: 14px;
}

.cust-slot-table .custom-color-text {
  font-size: 12px;
  font-weight: 500;
}

.cust-slot-table .custom-color-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 180px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  max-height: 220px;
  overflow-y: auto;
  z-index: 300;
}

.cust-slot-table .custom-color-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 12px;
  color: #1e293b;
  cursor: pointer;
}

.cust-slot-table .custom-color-menu-item:hover {
  background: #f1f5f9;
}

.cust-slot-table .custom-color-menu-item.selected {
  background: #eef2ff;
  font-weight: 600;
  color: #4338ca;
}

/* Preview Buttons & Controls */
.btn-preview-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px;
  min-height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
  user-select: none;
}
.btn-preview-trigger:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.15);
}
.btn-preview-trigger .preview-trigger-icon {
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-preview-trigger .preview-trigger-content {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  text-align: left !important;
  line-height: 1.15 !important;
  gap: 2px !important;
}
.btn-preview-trigger .preview-trigger-title {
  display: block !important;
  font-size: 11.5px !important;
  font-weight: 750 !important;
  color: #1d4ed8 !important;
  letter-spacing: 0.2px !important;
  white-space: nowrap !important;
}
.btn-preview-trigger .preview-trigger-chip,
.preview-trigger-chip {
  display: inline-flex !important;
  align-items: center !important;
  background: #ffffff !important;
  color: #1e40af !important;
  font-weight: 700 !important;
  padding: 1px 7px !important;
  border-radius: 8px !important;
  border: 1px solid #bfdbfe !important;
  font-size: 10.5px !important;
  letter-spacing: 0.3px !important;
  white-space: nowrap !important;
  line-height: 1.3 !important;
}

/* Customizer Stock Refresh Buttons */
.btn-refresh-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  min-height: 44px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 10px;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  color: #15803d;
  border: 1px solid #bbf7d0;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(22, 163, 74, 0.08);
  user-select: none;
  white-space: nowrap;
}
.btn-refresh-trigger:hover {
  background: #dcfce7;
  border-color: #86efac;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(22, 163, 74, 0.15);
}
.btn-refresh-trigger:active {
  transform: translateY(0);
}
.btn-refresh-trigger:disabled,
.btn-refresh-mini:disabled,
.btn-refresh-bottom:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}
.btn-refresh-trigger.is-refreshing .refresh-icon,
.btn-refresh-mini.is-refreshing .refresh-icon,
.btn-refresh-bottom.is-refreshing .refresh-icon,
.refresh-icon.is-spinning {
  display: inline-block;
  animation: spinStockRefresh 0.8s linear infinite;
}
@keyframes spinStockRefresh {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.btn-refresh-mini {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 650;
  border-radius: 6px;
  background: #f8fafc;
  color: #0f766e;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.btn-refresh-mini:hover {
  background: #f0fdf4;
  color: #15803d;
  border-color: #86efac;
  transform: translateY(-1px);
}
.btn-refresh-mini:active {
  transform: translateY(0);
}

/* Base Modular: Per-Slot Badge (TOP / Added) di samping Dropdown (Lebar identik 44px agar dropdown sejajar lurus) */
.slot-base-top-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 34px;
  padding: 0;
  box-sizing: border-box;
  font-size: 11px;
  font-weight: 800;
  border-radius: 7px;
  background: #15803d;
  color: #ffffff;
  letter-spacing: 0.6px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  user-select: none;
}

.slot-base-added-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 34px;
  padding: 0;
  box-sizing: border-box;
  font-size: 18px;
  font-weight: 800;
  border-radius: 7px;
  background: #2563eb;
  color: #ffffff;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  user-select: none;
}

.cust-slot-base-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.cust-slot-cell-base {
  vertical-align: middle;
}

.is-base-po-row .cust-slot-cell-base {
  background: #fffbeb;
}

.cust-slot-cell-base .cust-slot-mobile-label {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.cust-action-buttons-row {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
}

.btn-preview-bottom {
  flex: 1;
  min-width: 150px;
  height: 48px;
  padding: 0 18px;
  font-size: 14.5px;
  font-weight: 700;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  border-radius: 10px;
  background: #ffffff;
  color: #1e293b;
  border: 1.5px solid #cbd5e1;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.18s ease;
}

.btn-preview-bottom:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.btn-preview-bottom span,
.btn-preview-bottom .btn-preview-icon,
.btn-preview-bottom .btn-preview-text,
.btn-preview-trigger span {
  width: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
}

.btn-preview-bottom .btn-preview-icon {
  font-size: 16px;
  line-height: 1;
}

.cust-floating-preview-fab {
  display: none;
}

/* Desktop Defaults for Slot Card Elements */
.cust-slot-mobile-label {
  display: none;
}
.cust-slot-card-title {
  display: none;
}
.cust-slot-status-pill {
  display: none;
}
.cust-slot-header-mobile {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Status Chips */
.status-po-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 2px 8px;
  border-radius: 12px;
}
.status-ready-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  padding: 2px 8px;
  border-radius: 12px;
}
.status-empty-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 2px 8px;
  border-radius: 12px;
}

/* ==========================================================================
   Customizer Step 3 & PO Dynamic Stock Indicators
   ========================================================================== */
.color-palette-3col-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 860px) {
  .color-palette-3col-grid {
    grid-template-columns: 1fr;
  }
}

.dual-default-colors-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .dual-default-colors-grid {
    grid-template-columns: 1fr;
  }
}

.keycap-item.is-empty-keycap {
  border: 2px dashed #cbd5e1 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  opacity: 0.85;
}

.sub-label-color {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.po-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 800;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 4px;
  margin-left: auto;
  line-height: 1.2;
}

.po-chip-sm {
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  font-size: 9.5px;
  font-weight: 700;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 3px;
  margin-left: auto;
  line-height: 1.2;
}

.cust-slot-badge.is-po {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
}

.cust-slot-table tr.is-po-row {
  background: #fffbeb;
}

.cust-slot-table tr.is-po-row:hover {
  background: #fef3c7;
}

.custom-color-select-trigger.is-po-trigger {
  border-color: #fde68a !important;
  background-color: #fffdf5 !important;
}

.custom-color-menu-item.is-po-item {
  color: #92400e;
}

.badge-warning-po {
  background: #fef3c7 !important;
  color: #92400e !important;
  border-color: #fde68a !important;
}

.badge-ready-all {
  background: #ecfdf5 !important;
  color: #065f46 !important;
  border-color: #a7f3d0 !important;
}

/* ==========================================================================
   Modal Dialogs & Action Buttons
   ========================================================================== */
.agy-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100050 !important;
  padding: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Modal konfirmasi & prompt selalu tampil di atas modal lainnya (slicer, dll) */
#actionConfirmModalOverlay,
#actionPromptModalOverlay {
  z-index: 200050 !important;
}

/* Sembunyikan bottom navigation mobile saat modal/popup sedang terbuka agar tidak menutupi tombol footer */
body.modal-open .mobile-bottom-nav,
body:has(.agy-modal-overlay[style*="display: flex"]) .mobile-bottom-nav,
body:has(.agy-modal-overlay[style*="display: block"]) .mobile-bottom-nav,
body:has(.agy-modal-overlay[style*="display:flex"]) .mobile-bottom-nav,
body:has(.agy-modal-overlay[style*="display:block"]) .mobile-bottom-nav,
body:has(#modalMenuReorder.open) .mobile-bottom-nav,
body:has(#mobileMoreSheetOverlay[style*="display: flex"]) .mobile-bottom-nav,
body:has(#mobileMoreSheetOverlay[style*="display: block"]) .mobile-bottom-nav {
  display: none !important;
}

.agy-modal,
.modal-box {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: agyModalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes agyModalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.agy-modal-header,
.print-sheet-header,
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  background: #ffffff;
  flex-shrink: 0;
}

.agy-modal-close,
.btn-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.15s;
}

.agy-modal-close:hover,
.btn-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.agy-modal-body,
.print-sheet-body,
.modal-body {
  padding: 16px 18px;
  background: #ffffff;
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.agy-modal-footer,
.print-sheet-footer,
.modal-footer {
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
  flex-shrink: 0;
}

.btn-action-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #3b82f6;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-edit:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.finance-icon-action {
  transition: all 0.15s ease;
}

.finance-icon-action:hover {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  border-color: #94a3b8 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Standard Table Action Icon Button (Grey Color Theme) */
.table-icon-action {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s ease;
}

.table-icon-action:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #94a3b8;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.table-icon-action.table-icon-action-delete:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
}

/* =============================================================================
   STOCK MONITORING STYLES (HABIS & MENIPIS)
   ============================================================================= */

.monitor-status-btn {
  transition: all 0.18s ease;
}

.monitor-status-btn[data-status="empty"].active {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border-color: #fca5a5 !important;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
}

.monitor-status-btn[data-status="low"].active {
  background: #fef3c7 !important;
  color: #92400e !important;
  border-color: #fcd34d !important;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.15);
}

.monitor-base-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
  transition: all 0.15s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.monitor-base-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.monitor-slot-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
  text-align: center;
  box-sizing: border-box;
}

.monitor-slot-pill.slot-empty {
  background: #fef2f2;
  color: #dc2626;
  border: 1px dashed #f87171;
  font-weight: 750;
}

.monitor-slot-pill.slot-low {
  background: #fffbeb;
  color: #b45309;
  border: 1.5px solid #f59e0b;
  font-weight: 750;
}

.monitor-slot-pill.slot-ok {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #86efac;
}

.monitor-slot-pill.slot-none {
  background: #f8fafc;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}

.monitor-char-card {
  border-radius: 8px;
  padding: 8px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
  cursor: pointer;
  position: relative;
}

.monitor-char-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.monitor-char-card.is-selected {
  outline: 2.5px solid #2563eb !important;
  outline-offset: 1px;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25) !important;
}

.monitor-char-card.is-selected::after {
  content: "✓";
  position: absolute;
  top: -5px;
  right: -5px;
  width: 15px;
  height: 15px;
  background: #2563eb;
  color: #ffffff;
  border-radius: 50%;
  font-size: 9.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.monitor-char-card .char-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
}

.monitor-char-card .char-sub {
  font-size: 10px;
  font-weight: 700;
  margin-top: 3px;
  padding: 1px 5px;
  border-radius: 4px;
}

.monitor-char-card.is-empty {
  background: #fef2f2;
  border: 2px solid #ef4444;
  color: #991b1b;
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.12);
}

.monitor-char-card.is-empty .char-sub {
  background: #fee2e2;
  color: #b91c1c;
}

.monitor-char-card.is-low {
  background: #fffbeb;
  border: 2px solid #f59e0b;
  color: #92400e;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.12);
}

.monitor-char-card.is-low .char-sub {
  background: #fef3c7;
  color: #b45309;
}

.monitor-char-card.is-ok {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  color: #166534;
}

.monitor-char-card.is-ok .char-sub {
  background: #dcfce7;
  color: #15803d;
}

.monitor-emoji-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.15s ease;
}

.monitor-emoji-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
}

.monitor-emoji-card.is-empty {
  border: 1.5px solid #ef4444;
  background: #fffafa;
}

.monitor-emoji-card.is-low {
  border: 1.5px solid #f59e0b;
  background: #fffdfa;
}

.monitor-emoji-card.is-ok {
  border: 1.5px solid #86efac;
  background: #ffffff;
}

/* ==========================================================================
   Print Order / Work Order Modal Sheet
   ========================================================================== */
.print-sheet-header {
  padding: 18px 22px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.print-sheet-title {
  font-size: 16.5px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.print-sheet-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.print-sheet-body {
  padding: 22px;
  max-height: 75vh;
  overflow-y: auto;
}

.filament-card-info {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.filament-swatch-lg {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.12);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.filament-meta h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.filament-meta p {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: #64748b;
}

.slots-print-grid,
.letters-print-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.slot-print-box,
.letter-print-box {
  background: #ffffff;
  border: 1.5px solid #fca5a5;
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  box-sizing: border-box;
}

.slot-print-box.is-low,
.letter-print-box.is-low {
  border-color: #fde68a;
  background: #fffdf5;
}

.slot-print-box .slot-no {
  font-size: 12.5px;
  font-weight: 800;
  color: #0f172a;
}

.slot-print-box .slot-stock {
  font-size: 10.5px;
  color: #b91c1c;
  font-weight: 700;
  margin-top: 2px;
}

.slot-print-box.is-low .slot-stock {
  color: #b45309;
}

.slot-print-box .slot-target {
  margin-top: 6px;
  font-size: 11px;
  background: #fee2e2;
  color: #991b1b;
  padding: 2px 4px;
  border-radius: 4px;
  font-weight: 750;
}

.slot-print-box.is-low .slot-target {
  background: #fef3c7;
  color: #92400e;
}

.letter-print-box .letter-char {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.letter-print-box .letter-stock {
  font-size: 10.5px;
  color: #b91c1c;
  font-weight: 700;
}

.letter-print-box .letter-target {
  margin-top: 4px;
  font-size: 11px;
  background: #fee2e2;
  color: #991b1b;
  padding: 2px 4px;
  border-radius: 4px;
  font-weight: 750;
}

.print-summary-alert {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #1e40af;
  margin-bottom: 6px;
}

.print-sheet-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.print-sheet-footer {
  padding: 14px 22px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.print-sheet-footer-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.print-sheet-utility-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.base-slot-print-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.base-slot-print-grid.grid-10 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

@media print {
  body * {
    visibility: hidden;
  }
  #printOrderModalOverlay,
  #printOrderModalOverlay * {
    visibility: visible;
  }
  #printOrderModalOverlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: none !important;
    padding: 0 !important;
  }
  .print-sheet-footer,
  .btn-close-print-modal {
    display: none !important;
  }
  .agy-modal.print-order-modal {
    box-shadow: none !important;
    border: 1px solid #000 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
}

/* ==========================================================================
   PRINT QUEUE TRACKER STYLES
   ========================================================================== */
.queue-badge-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
  margin-left: 6px;
  line-height: 1;
  animation: agyBadgePulse 2s infinite;
}

@keyframes agyBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
}

.btn-filter-queue {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px;
}

.btn-filter-queue:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-filter-queue.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.print-queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 16px;
  margin-top: 6px;
}

.print-job-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.print-job-card:hover {
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.08);
}

.print-job-card.is-active {
  border-color: #93c5fd;
}

.print-job-card.is-queued {
  border-color: #fde047;
  background: #fefce8;
}

.print-job-card.is-completed {
  border-color: #bbf7d0;
  background: #fafdfb;
}

.print-job-card.is-failed {
  border-color: #fca5a5;
  background: #fffcfc;
}

.job-card-header {
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.job-card-header.is-active {
  background: #eff6ff;
  border-bottom-color: #dbeafe;
}

.job-card-header.is-queued {
  background: #fef9c3;
  border-bottom-color: #fef08a;
}

.job-card-header.is-completed {
  background: #f0fdf4;
  border-bottom-color: #dcfce7;
}

.job-card-header.is-failed {
  background: #fef2f2;
  border-bottom-color: #fee2e2;
}

.job-type-pill {
  font-size: 11.5px;
  font-weight: 750;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.job-status-pill {
  font-size: 11.5px;
  font-weight: 750;
  padding: 4px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.job-status-pill.status-printing {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.job-status-pill.status-queued {
  background: #fef9c3;
  color: #a16207;
  border: 1px solid #fef08a;
}

.job-status-pill.status-completed {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.job-status-pill.status-failed {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Dual Time Tracker Box (Slicer Target vs Real Duration) */
.job-time-tracker-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-time-tracker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tracker-col {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tracker-label {
  font-size: 10.5px;
  font-weight: 750;
  color: #64748b;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tracker-val-large {
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
  font-family: 'SF Mono', Monaco, Consolas, 'Courier New', monospace;
}

.tracker-val-sub {
  font-size: 11px;
  color: #64748b;
}

.tracker-overdue {
  color: #dc2626 !important;
  font-weight: 800;
}

#queueKpiGrid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 960px) {
  #queueKpiGrid4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  #queueKpiGrid4 {
    grid-template-columns: 1fr;
  }
}

.job-card-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.job-filament-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
}

/* ── Job Items Chips: Flex-wrap agar label tidak terpotong ── */
.job-items-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 160px;
  overflow-y: auto;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
}

.job-items-chips::-webkit-scrollbar {
  height: 4px;
  width: 4px;
}

.job-items-chips::-webkit-scrollbar-track {
  background: #f8fafc;
  border-radius: 4px;
}

.job-items-chips::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.job-items-chips::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.job-item-chip {
  background: #ffffff;
  border: 1px solid #dde3ed;
  border-radius: 7px;
  padding: 4px 5px 4px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;        /* biarkan chip selebarnya konten */
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}

.job-item-chip:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: 0 1px 4px rgba(37,99,235,0.10);
}

.job-item-chip .chip-char {
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  /* Tanpa overflow: hidden — konten tampil penuh */
  white-space: nowrap;
}

.job-item-chip .chip-qty {
  background: #2563eb;
  color: #ffffff;
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 10.5px;
  font-weight: 750;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.3;
}

.job-timer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #64748b;
  border-top: 1px dashed #e2e8f0;
  padding-top: 10px;
}

.job-card-footer {
  padding: 12px 16px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 rgba(37, 99, 235, 0.4);
  animation: agyPulseDot 1.5s infinite;
}

@keyframes agyPulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* ==========================================================================
   STOCK OPNAME & MODE SWITCHER STYLES
   ========================================================================== */
.batch-mode-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  cursor: pointer;
}
.batch-mode-btn:hover {
  background: #f1f5f9;
  color: var(--text-main);
}
.batch-mode-btn.active {
  background: #eff6ff;
  color: #1d4ed8;
  border: 2px solid #3b82f6;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.18);
  font-weight: 800;
}


/* Opname Alphabet & Numeric Pill Bar */
.opname-char-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.opname-char-pill {
  flex: 1 0 calc(7.69% - 6px);
  min-width: 44px;
  height: 48px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  padding: 2px;
}
.opname-char-pill:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: translateY(-1px);
}
.opname-char-pill.active {
  border-color: #2563eb !important;
  background: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.opname-char-pill.active .pill-char {
  color: #ffffff !important;
}
.opname-char-pill.active .pill-badge {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}
.opname-char-pill.has-stock:not(.active) {
  border-color: #86efac;
  background: #f0fdf4;
}
.opname-char-pill.has-stock:not(.active) .pill-badge {
  background: #dcfce7;
  color: #15803d;
}
.pill-char {
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  color: #0f172a;
}
.pill-badge {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  margin-top: 3px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #f1f5f9;
}

/* Quick Color Combo Chips */
.opname-combo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.opname-combo-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.opname-combo-chip:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(59, 130, 246, 0.15);
}
.opname-combo-chip .custom-color-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  display: inline-block;
}

/* Dynamic Color Rows */
.opname-color-row {
  display: grid;
  grid-template-columns: 2fr 2fr 1.3fr 1.2fr 40px;
  gap: 10px;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 8px;
  transition: border-color 0.15s ease;
  position: relative;
}
.opname-color-row:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}
.opname-color-row.has-open-dropdown {
  position: relative;
  z-index: 200;
}
.opname-color-row .custom-color-select-wrap.open {
  z-index: 210;
}
.opname-color-row .color-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.opname-color-row .color-swatch-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}
.opname-color-row .custom-color-select-wrap {
  flex: 1;
  min-width: 0;
}
.opname-color-row .custom-color-select-trigger {
  padding: 6px 10px;
  font-size: 12px;
  min-height: 34px;
}
.opname-color-row .custom-color-dot {
  width: 14px;
  height: 14px;
}
.opname-color-row .custom-color-text {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.opname-color-row .custom-color-menu {
  min-width: 220px;
  max-height: 220px;
  z-index: 300;
}
.opname-color-row .custom-color-menu-item {
  font-size: 12px;
  padding: 7px 10px;
}
.opname-color-row-header {
  display: grid;
  grid-template-columns: 2fr 2fr 1.3fr 1.2fr 40px;
  gap: 10px;
  padding: 0 12px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .header {
    padding: max(10px, env(safe-area-inset-top)) 12px 10px;
    gap: 8px;
  }
  .header-brand h1 {
    font-size: 14.5px;
  }
  .header-brand p {
    font-size: 10px;
  }
  .header-brand .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  .header-user-profile {
    gap: 5px !important;
  }
  .nav-tabs {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 4px;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }
  .opname-color-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .opname-color-row-header {
    display: none;
  }
}

/* ==========================================================================
   Login Screen Overlay & Modal Card
   ========================================================================== */
.login-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  padding: 16px;
}

.login-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(226, 232, 240, 0.8);
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
  animation: loginFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginFadeIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-icon {
  font-size: 38px;
  margin-bottom: 8px;
  display: inline-block;
  background: #eff6ff;
  width: 64px;
  height: 64px;
  line-height: 64px;
  border-radius: 18px;
  border: 1px solid #bfdbfe;
}

.login-brand h2 {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.login-brand p {
  font-size: 13.5px;
  color: #64748b;
  margin-top: 4px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field label {
  font-size: 13px;
  font-weight: 650;
  color: #334155;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-wrap .input-icon {
  position: absolute;
  left: 14px;
  font-size: 15px;
  pointer-events: none;
  opacity: 0.7;
}

.login-input-wrap input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  font-size: 14.5px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  outline: none;
  transition: all 0.2s ease;
}

.login-input-wrap input:focus {
  background: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn-toggle-pwd {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.btn-toggle-pwd:hover {
  opacity: 1;
}

.login-error-alert {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.btn-login-submit {
  width: 100%;
  padding: 13px 20px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
  margin-top: 4px;
}

.btn-login-submit:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-login-submit:active {
  transform: translateY(0);
}

.btn-login-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 11.5px;
  color: #94a3b8;
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION BAR & BOTTOM SHEET
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  z-index: 9999;
  justify-content: space-around;
  align-items: center;
}

.mobile-nav-item {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  transition: all 0.15s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item * {
  pointer-events: none;
}

.mobile-sheet-btn * {
  pointer-events: none;
}

.mobile-nav-item.active {
  color: #2563eb;
  font-weight: 750;
}

.mobile-nav-icon {
  font-size: 20px;
  line-height: 1;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-item.active .mobile-nav-icon {
  transform: scale(1.1);
  transition: transform 0.15s ease;
}

.mobile-queue-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.4);
}

/* Mobile Bottom Sheet Modal */
.mobile-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  animation: sheetFadeIn 0.2s ease;
}

@keyframes sheetFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mobile-sheet {
  background: #ffffff;
  width: 100%;
  max-width: 500px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border-radius: 20px 20px 0 0;
  padding: 16px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  animation: sheetSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.mobile-sheet-handle {
  width: 40px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 2px;
  margin: 0 auto 14px;
}

.mobile-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.mobile-sheet-header h3 {
  font-size: 16px;
  font-weight: 750;
  color: #0f172a;
  margin: 0;
}

.mobile-sheet-close {
  background: #f1f5f9;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.mobile-sheet-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.mobile-sheet-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.15s ease;
}

.mobile-sheet-btn:active {
  background: #eff6ff;
  border-color: #bfdbfe;
  transform: scale(0.99);
}

.sheet-btn-icon {
  font-size: 24px;
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  height: 42px !important;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: grid !important;
  place-items: center !important;
  flex: 0 0 42px !important;
}

.sheet-btn-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.sheet-btn-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
}

.mobile-sheet-user-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

.mobile-sheet-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-logout-mobile {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* =========================================================================
   KPI METRIC CARDS RESPONSIVE STANDARD (PRINT QUEUE & MONITORING)
   ========================================================================= */
.queue-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.queue-kpi-card {
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  box-sizing: border-box;
}

.queue-kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.queue-kpi-info {
  min-width: 0;
  overflow: hidden;
  flex: 1;
}

.queue-kpi-label {
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-kpi-val {
  font-size: clamp(13px, 1.4vw, 19px);
  font-weight: 800;
  line-height: 1.25;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monitor-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.monitor-kpi-card {
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  box-sizing: border-box;
}

.monitor-kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.monitor-kpi-info {
  min-width: 0;
  overflow: hidden;
  flex: 1;
}

.monitor-kpi-label {
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monitor-kpi-val {
  font-size: clamp(14px, 1.3vw, 19px);
  font-weight: 800;
  line-height: 1.25;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Media Query: Active on <= 768px (Mobile & Small Tablets) */
@media (max-width: 768px) {
  html, body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    width: 100% !important;
  }
  body {
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)) !important;
  }
  .header, .top-header {
    padding: max(8px, env(safe-area-inset-top, 12px)) 10px 8px 10px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    gap: 6px !important;
  }
  .nav-tabs {
    display: none !important;
  }
  .mobile-bottom-nav,
  #mobileBottomNav,
  #mobileMoreSheetOverlay {
    display: none !important;
  }
  /* Mobile Performance Guard: Sembunyikan Menu Lab & Uji Coba (3D Heavy) */
  #navGroupLabUjiCoba,
  .lab-desktop-only,
  .sidebar-nav-item[data-tab="tabKeychainDesigner"],
  .sidebar-nav-item[data-tab="tabImageClickerTest"],
  .mobile-sheet-btn[onclick*="tabKeychainDesigner"],
  .mobile-sheet-btn[onclick*="tabImageClickerTest"],
  .mobile-nav-item[data-tab="tabKeychainDesigner"],
  .mobile-nav-item[data-tab="tabImageClickerTest"],
  #tabKeychainDesigner,
  #tabImageClickerTest {
    display: none !important;
  }
  /* Top Header Mobile: Compact User Profile & Single-Tap Logout */
  .header-env-toolbar,
  .header-divider-v {
    display: none !important;
  }
  .top-header .btn-menu-settings {
    display: none !important; /* Menu settings tersedia di drawer navigasi samping */
  }
  .header-user-profile,
  .top-header .header-user-profile {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }
  .header-user-card {
    padding: 3px 6px !important;
    gap: 5px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
  }
  .header-user-avatar {
    width: 22px !important;
    height: 22px !important;
    font-size: 13px !important;
  }
  .header-user-name {
    font-size: 11px !important;
    max-width: 65px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .header-user-role-badge {
    font-size: 8.5px !important;
    padding: 1px 4px !important;
  }
  .btn-header-action.btn-logout {
    padding: 5px 8px !important;
    font-size: 11px !important;
    gap: 4px !important;
    border-radius: 7px !important;
  }
  .btn-header-action.btn-logout svg {
    width: 13px !important;
    height: 13px !important;
  }
  .current-page-badge {
    display: none !important;
  }
  .container {
    padding: 12px 10px !important;
    margin: 0 !important;
    max-width: 100vw !important;
    width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }
  .card {
    padding: 16px 14px !important;
    border-radius: 12px !important;
    margin-bottom: 14px !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  .card-title {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  .card-title .btn-action {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Form Grids collapse to 1 column on mobile */
  .form-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .select-custom,
  input.select-custom,
  .custom-color-select-trigger {
    height: 42px !important;
    min-height: 42px !important;
    font-size: 14px !important;
  }

  .color-picker-row {
    height: 42px !important;
    min-height: 42px !important;
  }

  #opnameBaseTypeTabsBar,
  #baseTypeTabsBar,
  #customizerBaseTypeTabsBar {
    height: auto !important;
    min-height: 40px !important;
    max-height: none !important;
    flex-wrap: wrap !important;
  }

  /* Monitoring Base Cards on Mobile */
  .monitor-base-card {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 10px 8px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  .monitor-base-card > div:nth-child(1) {
    min-width: 100% !important;
    width: 100% !important;
  }
  /* 5 Kolom presisi (Row 1: Slot 1-5, Row 2: Slot 6-10) tanpa overflow */
  .monitor-base-card > div:nth-child(2) {
    margin: 4px 0 !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 4px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .monitor-base-card .monitor-slot-pill {
    padding: 4px 1px !important;
    flex-direction: column !important;
    gap: 1px !important;
    min-width: 0 !important;
    border-radius: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
    justify-content: center !important;
  }
  .monitor-base-card .monitor-slot-pill .slot-pill-title {
    font-size: 9.5px !important;
    font-weight: 750 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.15 !important;
    display: block !important;
    width: 100% !important;
    text-align: center !important;
  }
  .monitor-base-card .monitor-slot-pill .slot-pill-qty {
    font-size: 9.5px !important;
    font-weight: 700 !important;
    opacity: 0.95 !important;
    white-space: nowrap !important;
    line-height: 1.15 !important;
    display: block !important;
    width: 100% !important;
    text-align: center !important;
  }
  .monitor-base-card > div:nth-child(3),
  .monitor-base-card > div:nth-child(3) > div {
    min-width: 100% !important;
    width: 100% !important;
  }

  /* Monitoring Filter Dropdowns full width on mobile */
  #monitorBaseTypeSelect, #monitorBaseSearchInput {
    width: 100% !important;
    min-width: 100% !important;
    flex: 1 1 100% !important;
    box-sizing: border-box !important;
  }

  /* Subtabs Bar (Flexible full-width tabs with auto-wrapping text - Mobile Standard) */
  .sub-tabs-bar, .opname-subtabs-bar, .batch-nav-group {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    padding: 3px !important;
    margin-bottom: 12px !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  .sub-tab-btn, .opname-nav-btn, .batch-nav-btn, .inbound-parts-nav-btn, .inv-filter-btn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    font-size: 11px !important;
    padding: 6px 3px !important;
    min-height: 42px !important;
    white-space: normal !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.2 !important;
    border-radius: 7px !important;
    box-sizing: border-box !important;
  }

  .sub-tab-btn span, .opname-nav-btn span, .batch-nav-btn span, .inbound-parts-nav-btn span, .inv-filter-btn span {
    font-size: 14px !important;
    line-height: 1 !important;
  }

  /* Table & Form Responsiveness */
  .table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
  }
  .configurator-grid {
    max-width: 100% !important;
    overflow-x: hidden !important;
    width: 100% !important;
  }
  .preview-stage {
    max-width: 100% !important;
    overflow-x: auto !important;
  }

  .batch-mode-switcher-bar {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    padding: 6px !important;
  }
  .batch-mode-btn {
    flex: 1 !important;
    width: auto !important;
    padding: 9px 8px !important;
    font-size: 13px !important;
    justify-content: center !important;
  }

  .opname-slot-matrix-wrap {
    padding: 8px 4px !important;
  }
  #opnameBaseMatrixGrid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 4px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  #opnameBaseMatrixGrid .batch-char-card {
    padding: 6px 1px !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  #opnameBaseMatrixGrid .batch-char-title {
    font-size: 10px !important;
    margin-bottom: 2px !important;
    white-space: nowrap !important;
  }
  #opnameBaseMatrixGrid .batch-char-card div:nth-child(2) {
    font-size: 9.5px !important;
    font-weight: 600 !important;
    margin-bottom: 4px !important;
    white-space: nowrap !important;
    letter-spacing: -0.3px !important;
  }
  #opnameBaseMatrixGrid .opname-base-slot-input {
    font-size: 13px !important;
    padding: 3px 0 !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  /* Sembunyikan quick combo chips di mobile agar layar bersih dan tidak boros scroll */
  .opname-quick-combo-section {
    display: none !important;
  }

  /* ==========================================================================
     Mobile Typography Standard Rules (Apple HIG & Material Design 3)
     Memastikan ukuran teks di smartphone proporsional dan mudah dibaca
     ========================================================================== */
  .header-brand h1 {
    font-size: 16px !important;
  }
  .header-brand p {
    font-size: 11px !important;
  }
  .card-title {
    font-size: 14.5px !important;
  }
  .form-label {
    font-size: 11px !important;
  }
  .select-custom,
  input[type="text"],
  input[type="number"],
  select {
    font-size: 13.5px !important;
  }
  .custom-table th {
    font-size: 10.5px !important;
    padding: 6px 4px !important;
  }
  .custom-table td {
    font-size: 11px !important;
    padding: 8px 6px !important;
  }
  .print-sheet-title,
  .agy-modal-header {
    font-size: 15px !important;
  }
  .mobile-nav-item .mobile-nav-label {
    font-size: 10px !important;
  }
  .badge-subtle,
  .print-sheet-badge {
    font-size: 10px !important;
  }

  /* Adaptive KPI Metric Cards on Mobile (Strictly 3 cards in 1 row) */
  .queue-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin-bottom: 14px !important;
  }

  .queue-kpi-card {
    padding: 8px 4px !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 4px !important;
    min-width: 0 !important;
    border-radius: 8px !important;
  }

  .queue-kpi-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 14px !important;
    border-radius: 7px !important;
  }

  .queue-kpi-info {
    width: 100% !important;
    text-align: center !important;
  }

  .queue-kpi-label {
    font-size: 9.5px !important;
    margin-bottom: 1px !important;
  }

  .queue-kpi-val {
    font-size: 11px !important;
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.2 !important;
  }

  .monitor-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin-bottom: 14px !important;
  }

  .monitor-kpi-card {
    padding: 8px 4px !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 4px !important;
    min-width: 0 !important;
    border-radius: 8px !important;
  }

  .monitor-kpi-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 14px !important;
    border-radius: 7px !important;
  }

  .monitor-kpi-info {
    width: 100% !important;
    text-align: center !important;
  }

  .monitor-kpi-label {
    font-size: 9.5px !important;
    margin-bottom: 1px !important;
  }

  .monitor-kpi-val {
    font-size: 11.5px !important;
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.2 !important;
  }
}

/* ==========================================================================
   Collapsible Batch History Accordion
   ========================================================================== */
details.batch-history-details > summary::-webkit-details-marker,
details.batch-history-details > summary::marker {
  display: none !important;
}
details.batch-history-details summary {
  list-style: none !important;
  transition: opacity 0.15s ease;
}
details.batch-history-details summary:hover {
  opacity: 0.85;
}
details.batch-history-details[open] summary .accordion-toggle-hint {
  color: var(--primary-color, #2563eb) !important;
  font-weight: 600;
}

/* ==========================================================================
   Guide Module & Visual Catalog Styles
   ========================================================================== */
.guide-filter-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  width: auto !important;
  gap: 4px;
}
.guide-filter-btn span {
  width: auto !important;
  display: inline !important;
  font-size: inherit !important;
  font-weight: inherit !important;
}
.guide-filter-btn:hover {
  border-color: #3b82f6;
  color: #1d4ed8;
  background: #eff6ff;
}
.guide-filter-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* Button Cetak di Kartu Katalog Visual */
.btn-guide-print {
  width: 100% !important;
  padding: 8px 12px !important;
  font-size: 12.5px !important;
  font-weight: 750 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  color: #2563eb !important;
  background: #eff6ff !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
}
.btn-guide-print:hover {
  background: #dbeafe !important;
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
  transform: translateY(-1px);
}
.btn-guide-print span {
  width: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  text-align: center !important;
  flex: 0 0 auto !important;
}

/* Guide Section Nav Pills */
.guide-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: 20px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  font-size: 12px;
  font-weight: 650;
  color: #475569;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  line-height: 1.4;
}
.guide-nav-pill:hover {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
  box-shadow: 0 2px 6px rgba(59,130,246,0.12);
}
.guide-nav-pill.active {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 2px 8px rgba(29,78,216,0.22);
  font-weight: 750;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.guide-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  border-color: #93c5fd;
}

.guide-card-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 120px;
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  position: relative;
}
.guide-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
  mix-blend-mode: multiply;
  transition: transform 0.2s ease;
}
.guide-card:hover .guide-card-thumb img {
  transform: scale(1.06);
}

@media (max-width: 640px) {
  #guideCatalogGrid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .guide-card {
    padding: 10px !important;
  }
  .guide-card-thumb {
    max-height: 100px !important;
  }
}

/* ==========================================================================
   Slicer Filament & Time Confirmation Modal (#modalSlicerFilamentInput)
   ========================================================================== */
#modalSlicerFilamentInput .modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
}

#modalSlicerFilamentInput .modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

#modalSlicerFilamentInput .btn-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
#modalSlicerFilamentInput .btn-close:hover {
  color: #0f172a;
}

#modalSlicerFilamentInput .modal-body {
  padding: 16px 18px;
  background: #ffffff;
}

#modalSlicerFilamentInput .modal-footer {
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#modalSlicerFilamentInput .btn {
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 650;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

#modalSlicerFilamentInput .btn-link {
  background: none;
  border-color: transparent;
  color: #64748b;
  font-size: 12px;
}
#modalSlicerFilamentInput .btn-link:hover {
  color: #0f172a;
  text-decoration: underline;
}

#modalSlicerFilamentInput .btn-secondary {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
}
#modalSlicerFilamentInput .btn-secondary:hover {
  background: #f1f5f9;
}

#modalSlicerFilamentInput .btn-primary {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #2563eb;
  font-weight: 700;
}
#modalSlicerFilamentInput .btn-primary:hover {
  background: #1d4ed8;
}

#modalSlicerFilamentInput .input-bar-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

#modalSlicerFilamentInput .card-total-produk,
#modalSlicerFilamentInput .card-waktu-slicer {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 14px;
}

#modalSlicerFilamentInput .input-card-label {
  font-size: 12px;
  font-weight: 750;
  color: #1e40af;
  margin-bottom: 7px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#modalSlicerFilamentInput .input-group-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#modalSlicerFilamentInput .clean-input {
  width: 64px;
  font-size: 15px;
  font-weight: 750;
  color: #0f172a;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 5px 8px;
  background: #ffffff;
  outline: none;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#modalSlicerFilamentInput .clean-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

#modalSlicerFilamentInput .clean-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
  opacity: 1;
}

#modalSlicerFilamentInput .clean-input-time {
  width: 48px;
  height: 34px;
  padding: 4px 6px;
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#modalSlicerFilamentInput .clean-input-time:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

#modalSlicerFilamentInput .slicer-time-inputs {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

#modalSlicerFilamentInput .time-unit-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#modalSlicerFilamentInput .unit-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #1e40af;
}

#modalSlicerFilamentInput .eval-strip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

#modalSlicerFilamentInput .eval-col {
  display: flex;
  flex-direction: column;
}

#modalSlicerFilamentInput .eval-col-label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

#modalSlicerFilamentInput .eval-col-val {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  margin-top: 2px;
}

#modalSlicerFilamentInput .eval-hpp {
  color: #16a34a;
}

#modalSlicerFilamentInput .helper-text {
  font-size: 11.5px;
  color: #64748b;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#modalSlicerFilamentInput .slicer-desktop-table-container {
  display: block;
  width: 100%;
  overflow-x: auto;
}

#modalSlicerFilamentInput .slicer-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
  font-size: 12.5px;
}

#modalSlicerFilamentInput .slicer-table th {
  background: #f8fafc;
  padding: 9px 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid #e2e8f0;
}

#modalSlicerFilamentInput .slicer-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

#modalSlicerFilamentInput .fil-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #0f172a;
  font-size: 12px;
}

#modalSlicerFilamentInput .color-swatch {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

#modalSlicerFilamentInput .num-input {
  width: 80px;
  height: 36px;
  padding: 6px 8px;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  outline: none;
  background: #ffffff;
  color: #0f172a;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: inline-block;
}

#modalSlicerFilamentInput .num-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

#modalSlicerFilamentInput .num-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

#modalSlicerFilamentInput input[type="number"]::-webkit-outer-spin-button,
#modalSlicerFilamentInput input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#modalSlicerFilamentInput input[type="number"] {
  -moz-appearance: textfield;
}

#modalSlicerFilamentInput .row-total {
  font-weight: 750;
  color: #2563eb;
  text-align: right;
}

#modalSlicerFilamentInput .slicer-table tfoot td {
  background: #f8fafc;
  font-weight: 750;
  border-top: 1px solid #e2e8f0;
  border-bottom: none;
  padding: 10px 10px;
}

#modalSlicerFilamentInput .slicer-mobile-cards-container {
  display: none;
  margin-bottom: 14px;
}

#modalSlicerFilamentInput .mobile-fil-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 11px;
  margin-bottom: 8px;
  background: #f8fafc;
}

#modalSlicerFilamentInput .mobile-fil-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

#modalSlicerFilamentInput .mobile-fil-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

#modalSlicerFilamentInput .mobile-fil-total {
  font-size: 12px;
  font-weight: 800;
  color: #2563eb;
}

#modalSlicerFilamentInput .mobile-inputs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

#modalSlicerFilamentInput .mobile-input-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: center;
}

#modalSlicerFilamentInput .mobile-input-label {
  font-size: 10px;
  font-weight: 650;
  color: #64748b;
  text-transform: uppercase;
  text-align: center;
}

#modalSlicerFilamentInput .mobile-input-field {
  width: 100%;
  padding: 6px 4px;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  border: 1.5px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  outline: none;
  box-sizing: border-box;
}

#modalSlicerFilamentInput .mobile-input-field:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

#modalSlicerFilamentInput .notice-bar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11.5px;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

#modalSlicerFilamentInput .notice-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

#modalSlicerFilamentInput .notice-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  flex-shrink: 0;
}

#modalSlicerFilamentInput .efficiency-badge {
  font-size: 11px;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  #modalSlicerFilamentInput .input-bar-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  #modalSlicerFilamentInput .card-total-produk,
  #modalSlicerFilamentInput .card-waktu-slicer {
    padding: 10px 11px;
  }
  #modalSlicerFilamentInput .clean-input-time {
    width: 35px;
    padding: 3px 2px;
    font-size: 12.5px;
  }
  #modalSlicerFilamentInput .unit-label {
    font-size: 11px;
  }
  #modalSlicerFilamentInput .eval-strip {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px 10px;
  }
  #modalSlicerFilamentInput .slicer-desktop-table-container {
    display: none !important;
  }
  #modalSlicerFilamentInput .slicer-mobile-cards-container {
    display: block !important;
  }
  #modalSlicerFilamentInput .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }
  #modalSlicerFilamentInput .modal-footer .btn-group-right {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  #modalSlicerFilamentInput .modal-footer .btn-group-right .btn {
    flex: 1;
  }
  #modalSlicerFilamentInput .modal-footer #btnSlicerSkipDeduct {
    width: 100%;
    text-align: center;
    padding: 6px 0;
  }

  /* Responsive SPK / Work Order Modal Sheet on Mobile */
  .agy-modal.print-order-modal {
    width: 96% !important;
    max-height: 94vh !important;
  }
  .print-sheet-header {
    padding: 12px 14px !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }
  .print-sheet-title {
    font-size: 14px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
    flex: 1 !important;
  }
  .print-sheet-badge {
    font-size: 10px !important;
    padding: 2px 6px !important;
  }
  .print-sheet-date {
    display: none !important;
  }
  .print-sheet-body {
    padding: 12px 14px !important;
    max-height: 72vh !important;
  }
  .filament-card-info {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    margin-bottom: 14px !important;
  }
  .filament-card-info > div:last-child {
    width: 100% !important;
  }
  .filament-card-info span[style*="border-radius"] {
    display: inline-block !important;
    white-space: nowrap !important;
    font-size: 11px !important;
  }
  .base-slot-print-grid.grid-10,
  .base-slot-print-grid:not(.grid-10) {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
  }
  .slot-print-box {
    padding: 8px 10px !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }
  .slot-print-box .slot-no {
    font-size: 12.5px !important;
  }
  .slot-print-box .slot-stock {
    font-size: 11px !important;
  }
  .slot-print-box .slot-target {
    font-size: 11.5px !important;
  }
  .print-sheet-footer {
    padding: 12px 14px !important;
    flex-direction: column-reverse !important;
    gap: 8px !important;
    align-items: stretch !important;
  }
  .print-sheet-footer .btn-close-print-modal {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 9px 14px !important;
  }
  .print-sheet-footer-right {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }
  .print-sheet-footer-right .btn-queue-action {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 11px 16px !important;
    order: -1 !important;
  }
  .print-sheet-utility-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    width: 100% !important;
    gap: 8px !important;
  }
  .print-sheet-utility-row .btn {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 8px 10px !important;
  }
}

/* Validasi Input Error Highlight & Shake Animation */
.input-field-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
  animation: inputFieldShake 0.35s ease-in-out !important;
}

@keyframes inputFieldShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* =============================================================================
   INVENTORY TABLE & ACTION BUTTONS STANDARDIZATION
   ============================================================================= */
.stock-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 750;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  min-width: 54px;
}

.stock-pill.stock-empty {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border-color: #fca5a5 !important;
}

.btn-quick-deduct {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-quick-deduct:hover {
  background: #fecaca !important;
  border-color: #f87171 !important;
  color: #7f1d1d !important;
  transform: translateY(-1px);
}

.btn-quick-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-quick-edit:hover {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
  transform: translateY(-1px);
}

/* Contrast enhancement for batch presets */
#btnBasePreset20,
#btnBasePresetAll2,
#btnFixFlexyPresetAll2 {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  font-weight: 700;
  transition: all 0.15s ease;
}

#btnBasePreset20:hover,
#btnBasePresetAll2:hover,
#btnFixFlexyPresetAll2:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

#btnBaseReset,
#btnModularReset,
#btnFixFlexyReset,
#btnChunkyReset {
  background: #fff1f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-weight: 700;
  transition: all 0.15s ease;
}

#btnBaseReset:hover,
#btnModularReset:hover,
#btnFixFlexyReset:hover,
#btnChunkyReset:hover {
  background: #fee2e2;
  border-color: #f87171;
  color: #7f1d1d;
}

/* ==========================================================================
   Antrean Cetak Filter Bar & Badges (Desktop & Mobile)
   ========================================================================== */
.queue-filter-bar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  margin-bottom: 18px;
}

.queue-filter-section-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.queue-filter-heading {
  font-size: 11.5px;
  font-weight: 750;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.queue-filter-group {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-filter-queue {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #334155 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
  white-space: nowrap !important;
}

.btn-filter-queue:hover {
  border-color: #94a3b8 !important;
  background: #f1f5f9 !important;
}

.btn-filter-queue > span {
  width: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

.btn-filter-queue .filter-count-badge {
  background: #e2e8f0 !important;
  color: #334155 !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  padding: 1px 6px !important;
  border-radius: 10px !important;
  min-width: 18px !important;
  line-height: 1.2 !important;
  margin-left: 2px !important;
  display: inline-block !important;
  text-align: center !important;
}

.btn-filter-queue.active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
}

.btn-filter-queue.active .filter-count-badge {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

.queue-printer-filter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue-printer-filter-wrap label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.queue-printer-filter-wrap select {
  padding: 6px 12px;
  font-size: 12px;
  min-width: 170px;
  height: auto;
  border-radius: 8px;
}

@media (max-width: 640px) {
  .queue-filter-bar-container {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 10px 12px !important;
  }
  .queue-filter-section-left {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .queue-filter-group {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
    width: 100% !important;
  }
  .btn-filter-queue {
    width: 100% !important;
    padding: 7px 8px !important;
    font-size: 11.5px !important;
    justify-content: center !important;
  }
  .queue-printer-filter-wrap {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    border-top: 1px solid #f1f5f9 !important;
    padding-top: 8px !important;
  }
  .queue-printer-filter-wrap select {
    flex: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
  }
}

/* ==========================================================================
   Universal Button Text Center Alignment
   Semua tulisan dan ikon tombol diatur center presisi
   ========================================================================== */
button:not(.sidebar-nav-item),
.btn,
.btn-primary,
.btn-secondary,
.btn-submit,
.btn-action,
.agy-modal-footer button,
.print-sheet-footer button {
  text-align: center !important;
  justify-content: center !important;
}

button:not(.sidebar-nav-item):not(.guide-filter-btn):not(.btn-guide-print) > span:not(.filter-count-badge):not(.sidebar-nav-label):not(.nav-badge-pill):not(.btn-filter-icon):not(.btn-filter-text):not(.chip-char):not(.chip-qty):not(.sheet-btn-icon):not(.mobile-nav-icon):not(.action-tile-icon):not(.stepper-text):not(.order-code-label):not(.orders-kpi-icon):not(.btn-preview-icon):not(.btn-preview-text):not(.preview-trigger-chip):not(.env-mode-dot):not(.env-mode-label),
.btn:not(.btn-guide-print) > span:not(.btn-preview-icon):not(.btn-preview-text),
.btn-submit > span,
.btn-action > span,
#confirmModalBtnText,
#confirmModalCancelText,
#promptModalBtnText,
#promptModalCancelText {
  width: 100%;
  text-align: center !important;
  justify-content: center !important;
  display: inline-flex !important;
  align-items: center !important;
}

/* ==========================================================================
   Data Input Tulisan Merah (High Visibility for Verification)
   Angka input pada modal slicer dan popup validasi tampil merah mencolok
   ========================================================================== */
#modalSlicerFilamentInput input[type="text"]:not([readonly]) {
  color: #dc2626 !important;
  font-weight: 750 !important;
}

#modalSlicerFilamentInput input::placeholder {
  color: #94a3b8 !important;
  font-weight: 500 !important;
}

/* ==========================================================================
   QC Inspection & Partial Failure Matrix Styles
   ========================================================================== */
.qc-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.qc-summary-col {
  text-align: center;
}

.qc-summary-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.qc-summary-val {
  font-size: 16px;
  font-weight: 800;
}

.qc-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
  padding: 4px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  margin-bottom: 14px;
}

.qc-item-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.qc-item-card.has-scrap {
  border-color: #f87171 !important;
  background: #fef2f2 !important;
}

.qc-item-card.all-good {
  border-color: #86efac;
  background: #f0fdf4;
}

.qc-item-title {
  font-size: 14px;
  font-weight: 750;
  color: #0f172a;
}

.qc-item-target {
  font-size: 11px;
  color: #64748b;
}

.qc-qty-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
  width: 100%;
}

.qc-stepper-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s ease;
}

.qc-stepper-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.qc-qty-input {
  width: 44px;
  height: 28px;
  padding: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  outline: none;
}

.qc-qty-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.qc-scrap-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
}

/* Cloud Synchronization Badge in Print Queue */
.queue-cloud-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 650;
  padding: 4px 10px;
  border-radius: 20px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  white-space: nowrap;
  user-select: none;
  transition: all 0.25s ease;
}

.queue-cloud-badge .sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.queue-cloud-badge.is-syncing {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.queue-cloud-badge.is-syncing .sync-dot {
  background: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
  animation: syncPulse 1s infinite alternate;
}

.queue-cloud-badge.is-offline {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.queue-cloud-badge.is-offline .sync-dot {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

@keyframes syncPulse {
  0% { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1.25); opacity: 1; }
}

/* =============================================================================
   DASHBOARD UTAMA STYLING (RESPONSIVE KPI, HERO CARDS, QUICK ACTIONS, & FEEDS)
   ============================================================================= */

.dashboard-hero-card {
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  transition: all 0.25s ease;
}

.dashboard-hero-active {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1.5px solid #bfdbfe;
}

.dashboard-hero-idle {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px solid #e2e8f0;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.dashboard-kpi-card {
  border-radius: 12px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  min-width: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.dashboard-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.dashboard-kpi-body {
  min-width: 0;
  overflow: hidden;
  flex: 1;
}

.dashboard-kpi-title {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.4px;
  color: #64748b;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-kpi-value {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.dashboard-kpi-sub {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Quick Action Hub */
.dashboard-actions-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.dashboard-action-tile {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.dashboard-action-tile:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.08);
}

.action-tile-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.action-tile-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.action-tile-title {
  font-size: 11.5px;
  font-weight: 750;
  color: #0f172a;
  line-height: 1.2;
}

.action-tile-desc {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.2;
}

/* 2-Column Split: Urgent Items & Recent Batches */
.dashboard-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dashboard-section-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dashboard-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.btn-link-action {
  background: transparent;
  border: none;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.btn-link-action:hover {
  text-decoration: underline;
}

.dashboard-urgent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  margin-bottom: 6px;
}

.dashboard-urgent-item:last-child {
  margin-bottom: 0;
}

.dashboard-recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  margin-bottom: 6px;
}

.dashboard-recent-row:last-child {
  margin-bottom: 0;
}

/* Responsive Dashboard Media Queries */
@media (max-width: 1024px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-actions-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-header-wrap {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .dashboard-hero-card {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 14px !important;
  }
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .dashboard-actions-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }
  .dashboard-split-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 16px !important;
  }
  .dashboard-kpi-card {
    padding: 12px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 6px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
    min-height: 98px !important;
  }
  .dashboard-kpi-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 16px !important;
    border-radius: 8px !important;
  }
  .dashboard-kpi-body {
    width: 100% !important;
    min-width: 0 !important;
  }
  .dashboard-kpi-title {
    font-size: 9.5px !important;
    font-weight: 750 !important;
    letter-spacing: 0.3px !important;
    line-height: 1.2 !important;
    margin-bottom: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .dashboard-kpi-value {
    font-size: 16.5px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    margin: 2px 0 !important;
  }
  .dashboard-kpi-sub {
    font-size: 9.5px !important;
    line-height: 1.25 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .dashboard-actions-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }
  .dashboard-action-tile {
    padding: 10px 6px !important;
    gap: 6px !important;
    border-radius: 10px !important;
  }
  .action-tile-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 15px !important;
    border-radius: 8px !important;
  }
  .action-tile-title {
    font-size: 10px !important;
    font-weight: 750 !important;
    line-height: 1.15 !important;
  }
  .action-tile-desc {
    font-size: 8.5px !important;
    line-height: 1.15 !important;
    display: none !important;
  }
}

@media (max-width: 380px) {
  .dashboard-actions-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ==========================================================================
   ORDERS MANAGEMENT (KUMPULAN PESANAN PEMBELIAN)
   ========================================================================== */

.orders-header-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.orders-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.orders-kpi-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  position: relative;
  overflow: hidden;
}

.orders-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.07);
}

.orders-kpi-card:active {
  transform: scale(0.98);
}

.orders-kpi-card.is-waiting {
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.orders-kpi-card.is-waiting .orders-kpi-icon {
  background: #fef3c7;
  color: #b45309;
}
.orders-kpi-card.is-waiting .orders-kpi-title {
  color: #b45309;
}
.orders-kpi-card.is-waiting .orders-kpi-val {
  color: #92400e;
}

.orders-kpi-card.is-processing {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}
.orders-kpi-card.is-processing .orders-kpi-icon {
  background: #dbeafe;
  color: #1d4ed8;
}
.orders-kpi-card.is-processing .orders-kpi-title {
  color: #1d4ed8;
}
.orders-kpi-card.is-processing .orders-kpi-val {
  color: #1e40af;
}

.orders-kpi-card.is-ready {
  background: #ecfdf5;
  border: 1.5px solid #6ee7b7;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.12);
}
.orders-kpi-card.is-ready .orders-kpi-icon {
  background: #d1fae5;
  color: #047857;
}
.orders-kpi-card.is-ready .orders-kpi-title {
  color: #047857;
}
.orders-kpi-card.is-ready .orders-kpi-val {
  color: #065f46;
}

.orders-kpi-card.is-completed {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.orders-kpi-card.is-completed .orders-kpi-icon {
  background: #e2e8f0;
  color: #475569;
}
.orders-kpi-card.is-completed .orders-kpi-title {
  color: #64748b;
}
.orders-kpi-card.is-completed .orders-kpi-val {
  color: #334155;
}

.orders-kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 22px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.orders-kpi-body {
  flex: 1;
  min-width: 0;
}

.orders-kpi-title {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.orders-kpi-val {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.orders-kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Filter & Search Toolbar */
.orders-filter-bar-container {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.orders-search-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.orders-search-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
  pointer-events: none;
}

.orders-search-wrap input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 13px;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  transition: all 0.15s;
}

.orders-search-wrap input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.orders-filter-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-filter-order {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-filter-order:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

.btn-filter-order.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.filter-count-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 800;
  background: rgba(0,0,0,0.08);
}

.btn-filter-order.active .filter-count-badge {
  background: rgba(255,255,255,0.25);
  color: #ffffff;
}

/* Orders Cards Grid & Order Card */
.orders-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.order-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
}

.order-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
}

.order-card.highlight-ready {
  border: 2px solid #10b981;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 60px);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.order-code-block {
  display: flex;
  flex-direction: column;
}

.order-code-label {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.order-time-label {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.order-status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.status-badge-waiting {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.status-badge-processing {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.status-badge-ready {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #6ee7b7;
  animation: pulseReadyGlow 2.5s infinite;
}

@keyframes pulseReadyGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.status-badge-completed {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.status-badge-cancelled {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* Customer & Contact Box */
.order-customer-box {
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.order-cust-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.order-cust-name {
  font-size: 13px;
  font-weight: 750;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-cust-phone {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 1px;
}

.btn-whatsapp-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #25d366;
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp-pill:hover {
  background: #1ebc59;
  transform: scale(1.02);
}

.btn-whatsapp-pill:active {
  transform: scale(0.96);
}

/* Visual Stage Progress Stepper */
.order-stage-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 4px 6px;
  margin: 4px 0;
}

.order-stage-stepper::before {
  content: '';
  position: absolute;
  left: 24px;
  right: 24px;
  top: 15px;
  height: 3px;
  background: #e2e8f0;
  z-index: 1;
}

.stepper-progress-bar {
  position: absolute;
  left: 24px;
  top: 15px;
  height: 3px;
  background: #10b981;
  z-index: 2;
  max-width: calc(100% - 48px);
  transition: width 0.3s ease;
}

.stepper-step {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  padding: 0 4px;
}

.stepper-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  font-size: 10px;
  display: grid;
  place-items: center;
  color: #64748b;
  font-weight: 800;
  transition: all 0.2s;
}

.stepper-step.active .stepper-dot {
  background: #3b82f6;
  border-color: #2563eb;
  color: #ffffff;
}

.stepper-step.completed .stepper-dot {
  background: #10b981;
  border-color: #059669;
  color: #ffffff;
}

.stepper-step.is-ready .stepper-dot {
  background: #10b981;
  border-color: #047857;
  color: #ffffff;
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25);
}

.stepper-text {
  font-size: 9.5px;
  font-weight: 700;
  color: #94a3b8;
  white-space: nowrap;
}

.stepper-step.active .stepper-text,
.stepper-step.completed .stepper-text {
  color: #334155;
}

.stepper-step.is-ready .stepper-text {
  color: #047857;
  font-weight: 800;
}

/* Order Item Rows */
.order-items-preview {
  border-top: 1px dashed #e2e8f0;
  border-bottom: 1px dashed #e2e8f0;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-item-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
}

.order-item-desc {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.order-item-name {
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.order-item-custom-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.order-item-custom-tags .badge-custom-pill {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.order-item-price-calc {
  text-align: right;
  flex-shrink: 0;
  font-weight: 750;
  color: #0f172a;
}

.order-total-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
}

.order-payment-pill {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 750;
}

.order-payment-paid {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.order-payment-unpaid {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Action Buttons Bar in Order Card */
.order-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 4px;
}

.btn-order-action {
  flex: 1;
  min-width: 100px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 750;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.btn-order-action.btn-status-advance {
  background: #0f172a;
  color: #ffffff;
}

.btn-order-action.btn-status-advance:hover {
  background: #334155;
}

.btn-order-action.btn-ready-advance {
  background: #10b981;
  color: #ffffff;
}

.btn-order-action.btn-ready-advance:hover {
  background: #059669;
}

.btn-order-action.btn-complete-advance {
  background: #475569;
  color: #ffffff;
}

.btn-order-action.btn-reprint {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
  flex: 0 0 auto;
  min-width: 36px;
  padding: 7px 9px;
}

.btn-order-action.btn-reprint:hover {
  background: #f1f5f9;
}

/* Empty State */
.orders-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
}

.orders-empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.orders-empty-state h3 {
  font-size: 16px;
  font-weight: 750;
  color: #0f172a;
  margin: 0 0 6px 0;
}

.orders-empty-state p {
  font-size: 12.5px;
  color: #64748b;
  max-width: 420px;
  margin: 0 auto 16px;
}

/* Responsive Mobile Rules for Orders */
@media (max-width: 640px) {
  .orders-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .orders-kpi-card {
    padding: 10px 12px !important;
    gap: 10px !important;
  }
  .orders-kpi-icon {
    width: 36px !important;
    height: 36px !important;
    font-size: 18px !important;
  }
  .orders-kpi-title {
    font-size: 9.5px !important;
  }
  .orders-kpi-val {
    font-size: 16px !important;
  }
  .orders-kpi-sub {
    display: none !important;
  }
  .orders-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .orders-filter-bar-container {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .orders-search-wrap {
    min-width: 100% !important;
  }
  .orders-filter-group {
    display: flex !important;
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-bottom: 4px !important;
    gap: 6px !important;
  }
  .btn-filter-order {
    padding: 6px 11px !important;
    font-size: 11.5px !important;
    height: 32px !important;
    border-radius: 16px !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
  }
  .filter-count-badge {
    padding: 1px 6px !important;
    font-size: 10.5px !important;
    border-radius: 10px !important;
  }
}

/* ==========================================================================
   Customizer Mobile Responsive: Card per Slot & Floating Preview FAB
   ========================================================================== */
@media (max-width: 768px) {
  /* Sembunyikan tombol preview header di mobile karena sudah ada tombol FAB melayang */
  .btn-preview-trigger,
  #btnOpenKeychainPreview,
  .cust-header-actions .btn-preview-trigger {
    display: none !important;
  }

  .cust-header-actions {
    width: auto !important;
    margin-left: auto !important;
  }

  .cust-header-actions .btn-refresh-trigger {
    width: auto !important;
    flex: none !important;
    white-space: nowrap !important;
  }

  #tabConfigurator.active .cust-floating-preview-fab {
    display: inline-flex;
    position: fixed;
    bottom: calc(75px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    z-index: 9990;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 28px;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.45);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  #tabConfigurator.active .cust-floating-preview-fab:active {
    transform: scale(0.96);
  }
  .cust-floating-preview-fab .fab-badge {
    background: #ffffff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 10px;
  }
}

@media (max-width: 640px) {
  #custKeycapSlotsGroup .table-responsive {
    border: none !important;
    background: transparent !important;
    overflow: visible !important;
  }

  .cust-slot-table colgroup,
  .cust-slot-table thead {
    display: none !important;
  }

  .cust-slot-table,
  .cust-slot-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .cust-slot-table tr[data-slot-index] {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 12px 14px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    box-sizing: border-box !important;
    width: 100% !important;
    position: relative !important;
    transition: all 0.15s ease !important;
  }

  .cust-slot-table tr[data-slot-index]:focus-within {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15) !important;
  }

  .cust-slot-table tr.is-po-row {
    border-left: 4px solid #f59e0b !important;
    background: #fffdf8 !important;
  }

  .cust-slot-cell-badge {
    grid-column: 1 / -1 !important;
    display: block !important;
    padding: 0 0 8px 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
  }

  .cust-slot-header-mobile {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  .cust-slot-card-title {
    display: inline-block !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
  }

  .cust-slot-status-pill {
    display: inline-flex !important;
  }

  .cust-slot-cell-char {
    grid-column: 1 / -1 !important;
    display: block !important;
    padding: 0 !important;
    border: none !important;
  }

  .cust-slot-cell-body {
    grid-column: 1 !important;
    display: block !important;
    padding: 0 !important;
    border: none !important;
    min-width: 0 !important;
  }

  .cust-slot-cell-text {
    grid-column: 2 !important;
    display: block !important;
    padding: 0 !important;
    border: none !important;
    min-width: 0 !important;
  }

  .cust-slot-cell-base {
    grid-column: 1 / -1 !important;
    display: block !important;
    padding: 0 !important;
    border: none !important;
    min-width: 0 !important;
    margin-top: 4px !important;
  }

  .cust-slot-mobile-label {
    display: block !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    margin-bottom: 4px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
  }

  .cust-slot-table tr.has-open-dropdown,
  .cust-slot-table tr:focus-within {
    z-index: 200 !important;
  }

  .cust-slot-table .custom-color-select-wrap.open {
    z-index: 210 !important;
  }

  .cust-slot-cell-text .custom-color-menu {
    left: auto !important;
    right: 0 !important;
  }

  .cust-slot-cell-body .custom-color-menu {
    left: 0 !important;
    right: auto !important;
  }

  .cust-slot-table .custom-color-select-trigger {
    min-height: 36px !important;
    padding: 7px 9px !important;
  }

  /* Sembunyikan tombol preview di header pada tampilan mobile karena sudah ada FAB preview melayang */
  .btn-preview-trigger,
  #btnOpenKeychainPreview,
  .cust-header-actions .btn-preview-trigger {
    display: none !important;
  }

  .cust-header-actions {
    width: auto !important;
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .cust-header-actions .btn-refresh-trigger {
    flex: none !important;
    width: auto !important;
    padding: 6px 12px !important;
    min-height: 36px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }

  .cust-action-buttons-row {
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
  }

  /* Tombol Preview 3D di card disembunyikan di mobile — FAB floating sudah menggantikannya */
  .cust-action-buttons-row .btn-preview-bottom {
    display: none !important;
  }

  .cust-action-buttons-row #btnPosCheckout {
    width: 100% !important;
    min-width: 100% !important;
    flex: none !important;
    height: 48px !important;
    font-size: 14px !important;
  }

  .desktop-po-chip {
    display: none !important;
  }
}

/* ==========================================================================
   Keychain 3D Preview Modal: Luxury Studio Showcase & Tile Specs
   ========================================================================== */
#modalKeychainPreview .preview-stage {
  background: radial-gradient(ellipse at 50% 35%, #ffffff 0%, #f8fafc 50%, #e2e8f0 100%) !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 16px !important;
  padding: 56px 20px 48px !important;
  min-height: 290px !important;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(15, 23, 42, 0.05) !important;
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

#modalKeychainPreview .preview-stage::after {
  content: '';
  position: absolute;
  bottom: 22px;
  width: 70%;
  height: 22px;
  background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.16) 0%, rgba(15, 23, 42, 0) 75%);
  border-radius: 50%;
  pointer-events: none;
}

#modalKeychainPreview .preview-stage.is-3d-mode {
  padding: 10px !important;
  min-height: 370px !important;
}

#modalKeychainPreview .preview-stage.is-3d-mode::after {
  display: none !important;
}

#keychain3dWrap {
  width: 100%;
  height: 350px;
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
}

@media (max-width: 640px) {
  #modalKeychainPreview .preview-stage.is-3d-mode {
    min-height: 300px !important;
    padding: 8px !important;
  }
  #keychain3dWrap {
    height: 290px !important;
  }
}

#modalKeychainPreview .preview-hint {
  position: absolute;
  top: 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(203, 213, 225, 0.85);
  padding: 6px 16px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  color: #475569;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
}

#modalKeychainPreview .keychain-assembly {
  transform: scale(1.22);
  transform-origin: center center;
  margin: 15px 0;
  filter: drop-shadow(0 20px 24px rgba(15, 23, 42, 0.24)) drop-shadow(0 6px 10px rgba(15, 23, 42, 0.12));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 5;
}

/* Modern Specs Grid */
.keychain-preview-summary-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
}

.preview-spec-tile {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.preview-spec-tile.highlight-price {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border-color: #bfdbfe;
}

.spec-tile-label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.spec-word-chip {
  display: inline-block;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 2px;
}

.spec-color-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 650;
  color: #1e293b;
}

.spec-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #94a3b8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  display: inline-block;
  flex-shrink: 0;
}

.spec-price-pill {
  font-size: 16px;
  font-weight: 800;
  color: #2563eb;
}

/* Modal Buttons */
.btn-modal-close-round {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  line-height: 1;
}

.btn-modal-close-round:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
  transform: rotate(90deg);
}

.btn-preview-close {
  padding: 10px 22px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 10px;
  background: #ffffff;
  color: #475569;
  border: 1.5px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preview-close:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-preview-checkout {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.15s ease;
}

.btn-preview-checkout:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.btn-preview-checkout:active {
  transform: translateY(0);
}

/* Mobile Overrides */
@media (max-width: 640px) {
  #modalKeychainPreview .preview-stage {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 46px 12px 28px !important;
    min-height: 220px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #modalKeychainPreview .keychain-assembly {
    zoom: 0.75 !important;
    transform: none !important;
    margin: 8px auto !important;
    flex-shrink: 0 !important;
  }

  .keychain-preview-summary-card {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .btn-preview-checkout {
    flex: 1;
    justify-content: center;
  }
}

/* ==========================================================================
   Modal: Atur Urutan Menu (#modalMenuReorder)
   ========================================================================== */
#modalMenuReorder {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.72) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  display: none;
  justify-content: center !important;
  align-items: center !important;
  z-index: 99999 !important;
  padding: 16px !important;
}

#modalMenuReorder.open {
  display: flex !important;
}

#modalMenuReorder .modal-box {
  background: #ffffff !important;
  border-radius: 18px !important;
  box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.4), 0 0 0 1px rgba(226, 232, 240, 0.8) !important;
  border: 1px solid #cbd5e1 !important;
  width: 100% !important;
  max-width: 520px !important;
  max-height: 88vh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

#modalMenuReorder .modal-body {
  background: #ffffff !important;
  padding: 18px 20px !important;
  flex: 1 !important;
  overflow-y: auto !important;
}

.reorder-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.reorder-item-card:hover {
  border-color: #cbd5e1;
  background: #fbfcfe;
}

.reorder-item-card.is-mobile-primary {
  border-left: 4px solid #2563eb;
  background: #fcfdfe;
}

.reorder-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.reorder-item-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.reorder-item-card.is-mobile-primary .reorder-item-badge {
  background: #eff6ff;
  color: #2563eb;
}

.reorder-item-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.reorder-item-info {
  min-width: 0;
}

.reorder-item-title {
  font-size: 13.5px;
  font-weight: 750;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.reorder-item-desc {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.reorder-item-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.reorder-item-pill.mobile-primary {
  background: #dbeafe;
  color: #1e40af;
}

.reorder-item-pill.mobile-sheet {
  background: #f1f5f9;
  color: #64748b;
}

.reorder-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 10px;
}

.btn-reorder-move {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-reorder-move:hover:not(:disabled) {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.btn-reorder-move:active:not(:disabled) {
  transform: scale(0.92);
}

.btn-reorder-move:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: #f1f5f9;
}

/* ==========================================================================
   SANDBOX / TESTING MODE & INVENTORY SNAPSHOT STYLES
   ========================================================================== */

/* Top Sandbox Warning Banner */
.sandbox-warning-banner {
  background: linear-gradient(90deg, #b45309 0%, #d97706 50%, #b45309 100%);
  color: #ffffff;
  padding: max(8px, env(safe-area-inset-top, 0px)) 16px 8px 16px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.25);
  position: sticky;
  top: 0;
  z-index: 999;
}

.sandbox-banner-content {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sandbox-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sandbox-badge-pulse {
  background: #fef08a;
  color: #854d0e;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-sandbox-switch {
  background: #ffffff;
  color: #92400e;
  border: 1px solid #fef3c7;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-sandbox-switch:hover {
  background: #fef3c7;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .sandbox-warning-banner {
    padding: max(14px, env(safe-area-inset-top, 38px)) 14px 10px 14px !important;
    position: relative !important;
    font-size: 11.5px !important;
  }
  .sandbox-banner-content {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .sandbox-banner-left {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 5px !important;
  }
  .sandbox-badge-pulse {
    font-size: 10.5px !important;
  }
  .sandbox-banner-text {
    font-size: 11px !important;
    line-height: 1.4 !important;
    color: rgba(255, 255, 255, 0.95) !important;
  }
  .sandbox-banner-actions {
    width: 100% !important;
  }
  .btn-sandbox-switch {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
  }
}

/* Header Environment Switcher Badge */
.env-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  box-sizing: border-box;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 750;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  user-select: none;
}

.env-mode-badge:active {
  transform: scale(0.96);
}

.env-mode-badge.mode-live {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.env-mode-badge.mode-live:hover {
  background: #d1fae5;
}

.env-mode-badge.mode-sandbox {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.env-mode-badge.mode-sandbox:hover {
  background: #fde68a;
}

.env-mode-dot {
  width: 8px !important;
  height: 8px !important;
  min-width: 8px !important;
  max-width: 8px !important;
  flex: 0 0 8px !important;
  border-radius: 50% !important;
  display: inline-block !important;
}

.env-mode-badge.mode-live .env-mode-dot {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.env-mode-badge.mode-sandbox .env-mode-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Inventory Snapshot Card */
.inventory-snapshot-card {
  transition: all 0.2s ease;
}

.inventory-snapshot-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.badge-snapshot-status {
  display: inline-block;
  vertical-align: middle;
}

/* Snapshot Compare Modal Table */
.snapshot-compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}

.snapshot-compare-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid #cbd5e1;
}

.snapshot-compare-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
}

.snapshot-compare-table tr:nth-child(even) {
  background: #f8fafc;
}

/* =============================================================================
   MODULE SPECIFICATION & ROADMAP VIEW (FOR UPCOMING / INFO MODULES)
   ============================================================================= */
.nav-badge-pill.badge-roadmap {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
  font-size: 10px !important;
  font-weight: 750 !important;
  padding: 1px 6px !important;
  border-radius: 6px !important;
  letter-spacing: 0.2px;
}

.sidebar-nav-item.active .nav-badge-pill.badge-roadmap {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
}

.module-spec-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 8px 0 32px;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.module-spec-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
  flex-wrap: wrap;
  gap: 20px;
}

.module-spec-hero-left {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  flex: 1;
  min-width: 280px;
}

.module-spec-icon {
  font-size: 42px;
  width: 68px;
  height: 68px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.1);
}

.module-spec-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.module-spec-badge {
  font-size: 11px;
  font-weight: 750;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.module-spec-badge.badge-dev {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.module-spec-badge.badge-role {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.module-spec-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px 0;
  line-height: 1.3;
}

.module-spec-desc {
  font-size: 13.5px;
  color: #475569;
  margin: 0;
  line-height: 1.55;
  max-width: 680px;
}

.module-spec-hero-right {
  display: flex;
  align-items: center;
}

.module-spec-status-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 18px;
  text-align: right;
  min-width: 220px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.module-spec-status-box .status-label {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.module-spec-status-box .status-val {
  font-size: 14px;
  font-weight: 800;
  color: #2563eb;
  margin-bottom: 4px;
}

.module-spec-status-box .status-sub {
  font-size: 11px;
  color: #64748b;
}

.module-spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.module-spec-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
}

.module-spec-card .card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.module-spec-card .card-header .card-icon {
  font-size: 20px;
}

.module-spec-card .card-header h3 {
  font-size: 15px;
  font-weight: 750;
  color: #0f172a;
  margin: 0;
}

.module-spec-card .card-body {
  font-size: 13px;
  color: #334155;
  line-height: 1.6;
  flex: 1;
}

.spec-bullet-list {
  margin: 0;
  padding-left: 18px;
}

.spec-bullet-list li {
  margin-bottom: 8px;
}

.feature-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
}

.feature-timeline-item:last-child {
  margin-bottom: 0;
}

.feature-timeline-item .feat-check {
  font-size: 14px;
  flex-shrink: 0;
}

.workflow-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.workflow-step:last-child {
  margin-bottom: 0;
}

.workflow-step .step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}

.module-spec-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  padding: 16px 22px;
  flex-wrap: wrap;
  gap: 16px;
}

.module-spec-action-bar.blue {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.action-bar-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 260px;
}

.action-bar-info .action-icon {
  font-size: 26px;
  flex-shrink: 0;
}

.action-bar-info .action-title {
  font-size: 14px;
  font-weight: 750;
  color: #0f172a;
  margin-bottom: 2px;
}

.action-bar-info .action-desc {
  font-size: 12.5px;
  color: #475569;
}

.action-bar-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-module-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: #2563eb;
  color: #ffffff;
  border: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
}

.btn-module-action:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.btn-module-action.secondary {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-module-action.secondary:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
}

@media (max-width: 768px) {
  .module-spec-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 16px;
  }
  .module-spec-status-box {
    text-align: left;
    width: 100%;
  }
  .module-spec-action-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .action-bar-buttons {
    flex-direction: column;
  }
  .btn-module-action {
    justify-content: center;
    width: 100%;
  }
}

/* Lab Image Clicker Responsive Layout */
@media (max-width: 992px) {
  .image-clicker-lab-grid {
    grid-template-columns: 1fr !important;
  }
  #imgClicker3DContainer {
    height: 480px !important;
  }
}

/* ==========================================================================
   Mobile Performance Guard: Hide Lab & Uji Coba on Mobile / Native App
   ========================================================================== */
@media (max-width: 1024px) and (pointer: coarse) {
  #navGroupLabUjiCoba,
  .lab-desktop-only,
  .sidebar-nav-item[data-tab="tabKeychainDesigner"],
  .sidebar-nav-item[data-tab="tabImageClickerTest"],
  .mobile-sheet-btn[onclick*="tabKeychainDesigner"],
  .mobile-sheet-btn[onclick*="tabImageClickerTest"],
  .mobile-nav-item[data-tab="tabKeychainDesigner"],
  .mobile-nav-item[data-tab="tabImageClickerTest"],
  #tabKeychainDesigner,
  #tabImageClickerTest {
    display: none !important;
  }
}

body.is-mobile-device #navGroupLabUjiCoba,
body.is-mobile-device .lab-desktop-only,
body.is-mobile-device .sidebar-nav-item[data-tab="tabKeychainDesigner"],
body.is-mobile-device .sidebar-nav-item[data-tab="tabImageClickerTest"],
body.is-mobile-device .mobile-sheet-btn[onclick*="tabKeychainDesigner"],
body.is-mobile-device .mobile-sheet-btn[onclick*="tabImageClickerTest"],
body.is-mobile-device .mobile-nav-item[data-tab="tabKeychainDesigner"],
body.is-mobile-device .mobile-nav-item[data-tab="tabImageClickerTest"],
body.is-mobile-device #tabKeychainDesigner,
body.is-mobile-device #tabImageClickerTest {
  display: none !important;
}

/* Inventory Color Combo Card */
.inv-combo-card {
  transition: all 0.15s ease-in-out;
}
.inv-combo-card:hover {
  border-color: #93c5fd !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08) !important;
  transform: translateY(-2px);
}

/* ==========================================================================
   MODERN KASIR & POS (tabConfigurator) STEP-BY-STEP DESIGN SYSTEM
   ========================================================================== */
.kasir-step-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kasir-step-card:hover {
  border-color: #cbd5e1;
}

.kasir-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 8px;
}

.kasir-step-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kasir-step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kasir-step-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin: 0;
}

.kasir-step-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .kasir-step-grid-2col {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* Segmented Pill Tabs for Customizer Base Type */
#customizerBaseTypeTabsBar.segmented-pill-bar {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 18px;
}

#customizerBaseTypeTabsBar.segmented-pill-bar .sub-tab-btn {
  flex: 1;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  color: #475569;
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  transition: all 0.15s ease;
}

#customizerBaseTypeTabsBar.segmented-pill-bar .sub-tab-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  color: #0f172a;
}

#customizerBaseTypeTabsBar.segmented-pill-bar .sub-tab-btn.active {
  background: #ffffff !important;
  color: #2563eb !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 800 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

/* Refined BOM Sub-sections in Step 4 */
.kasir-bom-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.kasir-bom-section-title {
  font-size: 12.5px;
  font-weight: 750;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

/* ==========================================================================
   ANTREAN CETAK — Design System Refactor
   Print Queue Tab: header actions, segmented pills, clickable KPI cards
   ========================================================================== */

/* Header Action Area */
.pq-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.pq-btn-primary {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #bfdbfe !important;
  font-weight: 750 !important;
}

.pq-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.pq-btn-group .btn-action {
  border-radius: 0 !important;
  border: none !important;
  border-right: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  color: #334155 !important;
  font-size: 12px !important;
  padding: 6px 12px !important;
  font-weight: 600 !important;
}

.pq-btn-group .btn-action:last-child {
  border-right: none !important;
}

.pq-btn-group .btn-action:hover {
  background: #f1f5f9 !important;
  color: #1e40af !important;
}

/* KPI Cards — Clickable variant */
.queue-kpi-clickable {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.queue-kpi-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.queue-kpi-clickable:active {
  transform: translateY(0);
}

/* Control Bar (Filter + Printer Selector) */
.pq-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.pq-pill-wrap {
  flex: 1;
  min-width: 0;
}

/* Segmented Pill Filter */
.pq-segmented-pills {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
}

.pq-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  line-height: 1.2;
}

.pq-pill-btn:hover {
  background: rgba(255, 255, 255, 0.7);
  color: #1e40af;
}

.pq-pill-btn.active {
  background: #ffffff;
  color: #2563eb;
  font-weight: 750;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Count badge inside pill */
.pq-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #e2e8f0;
  color: #475569;
  font-size: 10.5px;
  font-weight: 750;
  border-radius: 10px;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.pq-pill-btn.active .pq-pill-count {
  background: #dbeafe;
  color: #1e40af;
}

/* Printer Selector Wrapper */
.pq-printer-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pq-printer-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

/* Responsive: Mobile */
@media (max-width: 640px) {
  .pq-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .pq-control-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .pq-segmented-pills {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    border-radius: 10px;
    padding: 4px;
  }

  .pq-pill-btn {
    justify-content: center;
    padding: 7px 8px;
    font-size: 11.5px;
  }

  .pq-printer-wrap {
    width: 100%;
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
  }

  .pq-printer-wrap select {
    flex: 1;
    min-width: 0;
  }
}

/* ==========================================================================
   MODAL PREVIEW 3D — Controls Bar Segmented Pill System
   ========================================================================== */

/* Controls Bar: wrapper untuk orientasi + mode view toggle */
.preview-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.preview-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-control-label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}

/* Segmented Pill Bar (dipakai di modal) */
.modal-pill-bar {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 3px;
}

/* Pill Button */
.modal-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  line-height: 1.3;
}

.modal-pill-btn:hover {
  background: rgba(255, 255, 255, 0.8);
  color: #1e40af;
}

.modal-pill-btn.active {
  background: #ffffff;
  color: #2563eb;
  font-weight: 750;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile: Stack controls vertically */
@media (max-width: 520px) {
  .preview-controls-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .modal-pill-bar {
    width: 100%;
  }

  .modal-pill-btn {
    flex: 1;
    justify-content: center;
  }
}

/* ==========================================================================
   MODAL HISTORY � Count Badge & Custom Color Combo Dropdown
   ========================================================================== */

/* Count badge kecil di dalam pill filter */
.hist-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  margin-left: 2px;
}

.modal-pill-btn.active .hist-count-badge {
  background: rgba(37, 99, 235, 0.15);
  color: #1d4ed8;
}

/* Custom Color Combo Dropdown (Pemantauan Huruf & Angka) */
.custom-color-select-trigger {
  border: 1.5px solid #cbd5e1;
  border-radius: 9px;
  background: #ffffff;
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 36px;
  user-select: none;
}

.custom-color-select-trigger:hover {
  border-color: #94a3b8;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.custom-color-trigger-content {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.custom-color-dot {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  display: inline-block;
}

.custom-color-arrow {
  font-size: 9px;
  color: #94a3b8;
  flex-shrink: 0;
}

.custom-color-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  max-height: 260px;
  overflow-y: auto;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 9999;
}

.custom-color-menu-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.1s ease;
  border-bottom: 1px solid #f8fafc;
}

.custom-color-menu-item:last-child {
  border-bottom: none;
}

.custom-color-menu-item:hover {
  background: #f1f5f9 !important;
}

.custom-color-menu-item.selected {
  background: #eff6ff !important;
  color: #1d4ed8;
}

/* =========================================================================
   FILAMEN INBOUND FORM — Clean Input Form Styles
   ========================================================================= */
.fil-form-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 5px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.fil-input {
  width: 100%;
  height: 42px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 12px;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.fil-input:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}
.fil-input-qty {
  font-size: 16px;
  font-weight: 750;
  text-align: center;
}
.fil-form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}
.fil-form-hint--green {
  color: #15803d;
  font-weight: 600;
  font-size: 11.5px;
}
.fil-optional-tag {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  background: #f1f5f9;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 3px;
  letter-spacing: 0;
  vertical-align: middle;
}
.fil-submit-btn {
  height: 42px;
  padding: 0 22px;
  font-size: 13.5px;
  font-weight: 750;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(37,99,235,0.25);
  transition: background 0.15s, box-shadow 0.15s;
}
.fil-submit-btn:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}

.custom-color-select-wrap[data-for="inboundFilamentColor"] .custom-color-select-trigger {
  height: 42px;
  min-height: 42px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  box-sizing: border-box;
}
.custom-color-hex-pill {
  display: none !important;
}

/* Mobile & Tablet: stack Inbound Filament Form columns */
@media (max-width: 768px) {
  .fil-grid-3col {
    grid-template-columns: 1fr !important;
  }
  .fil-grid-3col-bottom {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 520px) {
  .fil-form-row {
    grid-template-columns: 1fr !important;
  }
  .fil-form-row > div[style*="min-width"] {
    min-width: unset !important;
  }
}

/* ==========================================================================
   KASIR STEP 4 & BOM INCLUDED COMPONENTS REFACTOR
   Perapian daftar komponen termasuk, penataan switch/gantungan, dan pencegahan overflow
   ========================================================================== */

/* Prevent overflow in BOM section title & hints */
.kasir-bom-section-title {
  flex-wrap: wrap !important;
  max-width: 100% !important;
}

#custStrapPkgTypeHint {
  white-space: normal !important;
  word-break: break-word !important;
  max-width: 100% !important;
  line-height: 1.3 !important;
}

/* Card Strip Komponen Termasuk (Price Included Items) */
.price-included-item {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 12px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 9px !important;
  margin-bottom: 6px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  transition: background 0.15s ease, border-color 0.15s ease !important;
}

.price-included-item:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

.price-included-label-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  min-width: 0 !important;
  flex: 1 !important;
}

.price-included-num {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  background: #e2e8f0 !important;
  color: #475569 !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.price-included-name {
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  line-height: 1.35 !important;
  word-break: break-word !important;
}

/* Badge Termasuk & Free - Selalu utuh tidak pernah patah baris */
.text-include {
  color: #15803d !important;
  background: #dcfce7 !important;
  border: 1px solid #bbf7d0 !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.text-free {
  color: #047857 !important;
  background: #ecfdf5 !important;
  border: 1px solid #a7f3d0 !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

/* ==========================================================================
   MODAL PREVIEW CLICKER 3D FOOTER REFACTOR
   Keseimbangan tinggi tombol Tutup dan Lanjut Bayar di Kasir (Anti-wrap)
   ========================================================================== */

.preview-modal-footer {
  padding: 12px 18px !important;
  border-top: 1px solid #e2e8f0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 10px !important;
  background: #f8fafc !important;
  border-bottom-left-radius: 18px !important;
  border-bottom-right-radius: 18px !important;
}

.btn-preview-close {
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 20px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #475569 !important;
  border: 1.5px solid #cbd5e1 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  transition: all 0.15s ease !important;
}

.btn-preview-close:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

.btn-preview-checkout {
  height: 44px !important;
  min-height: 44px !important;
  flex: 1 !important;
  padding: 0 16px !important;
  font-size: 13.5px !important;
  font-weight: 750 !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  border: none !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28) !important;
  transition: all 0.15s ease !important;
}

.btn-preview-checkout:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.38) !important;
}

.btn-preview-checkout:active {
  transform: translateY(0) !important;
}

@media (max-width: 480px) {
  .preview-modal-footer {
    padding: 10px 14px !important;
    gap: 8px !important;
  }
  .btn-preview-close {
    padding: 0 14px !important;
    font-size: 13px !important;
  }
  .btn-preview-checkout {
    padding: 0 12px !important;
    font-size: 13px !important;
    gap: 6px !important;
  }
}

/* ==========================================================================
   FAB PREVIEW 3D & KASIR CHECKOUT BUTTON SAFETY REFACTOR
   Mencegah tombol Bayar di Kasir terhalang oleh Floating Preview FAB di mobile
   ========================================================================== */

#tabConfigurator.active .cust-floating-preview-fab {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, visibility 0.2s ease, box-shadow 0.15s ease !important;
}

#tabConfigurator.active .cust-floating-preview-fab.fab-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(28px) scale(0.85) !important;
  visibility: hidden !important;
}

@media (max-width: 640px) {
  #tabConfigurator {
    padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .cust-action-buttons-row {
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
    margin-bottom: 24px !important;
  }

  .cust-action-sub-buttons {
    display: flex !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .cust-action-buttons-row .btn-preview-bottom {
    display: inline-flex !important;
    height: 42px !important;
    min-height: 42px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    border-radius: 9px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 14px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #1e293b !important;
  }

  .cust-action-buttons-row #btnPosCheckout {
    width: 100% !important;
    min-width: 100% !important;
    flex: none !important;
    height: 50px !important;
    font-size: 14.5px !important;
    font-weight: 750 !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
  }
}

/* ==========================================================================
   MODAL KONFIRMASI INPUTAN PESANAN FOOTER REFACTOR
   Keseimbangan tinggi tombol Ubah Kembali dan Lanjut Bayar (Anti-wrap)
   ========================================================================== */

.order-confirm-modal-footer {
  padding: 12px 18px !important;
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 10px !important;
  border-bottom-left-radius: 18px !important;
  border-bottom-right-radius: 18px !important;
}

.btn-confirm-back {
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 16px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #475569 !important;
  border: 1.5px solid #cbd5e1 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  transition: all 0.15s ease !important;
}

.btn-confirm-back:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

.btn-confirm-proceed {
  height: 44px !important;
  min-height: 44px !important;
  flex: 1 !important;
  padding: 0 16px !important;
  font-size: 14px !important;
  font-weight: 750 !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  border: none !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
  transition: all 0.15s ease !important;
}

.btn-confirm-proceed:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45) !important;
}

.btn-confirm-proceed:active {
  transform: translateY(0) !important;
}

@media (max-width: 480px) {
  .order-confirm-modal-footer {
    padding: 10px 14px !important;
    gap: 8px !important;
  }
  .btn-confirm-back {
    padding: 0 12px !important;
    font-size: 12.5px !important;
    gap: 5px !important;
  }
  .btn-confirm-proceed {
    padding: 0 14px !important;
    font-size: 13.5px !important;
    gap: 6px !important;
  }
}


/* =========================================================================
   POS CHECKOUT MODAL DEDUCT LIST & FOOTER STYLING
   ========================================================================= */
#posCheckoutModalOverlay .print-sheet-body {
  padding: 18px 20px 24px !important;
  max-height: calc(85vh - 150px) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

.pos-deduct-item {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 10px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
}

.pos-deduct-item:hover {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
}

.pos-deduct-left {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
  flex: 1 !important;
  overflow: hidden !important;
}

.pos-deduct-color-dot {
  display: inline-block !important;
  width: 14px !important;
  height: 14px !important;
  border-radius: 50% !important;
  border: 1px solid #94a3b8 !important;
  flex-shrink: 0 !important;
}

.pos-deduct-char-badge {
  background: #0f172a !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
  line-height: 1.2 !important;
}

.pos-deduct-name {
  font-size: 12.5px !important;
  font-weight: 650 !important;
  color: #1e293b !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 0 !important;
  flex: 1 !important;
}

.pos-deduct-qty {
  font-size: 11px !important;
  color: #64748b !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.pos-deduct-right {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  display: flex !important;
  align-items: center !important;
}

.pos-stock-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  padding: 3px 8px !important;
  border-radius: 12px !important;
  font-weight: 750 !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  text-align: center !important;
}

.pos-stock-pill.in-stock {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #bbf7d0 !important;
}

.pos-stock-pill.out-stock {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border: 1px solid #fca5a5 !important;
}

/* POS Checkout Modal Footer Layout */
.pos-checkout-modal-footer {
  padding: 14px 20px !important;
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 12px !important;
}

.pos-checkout-action-right {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.pos-checkout-modal-footer .btn {
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  line-height: 1 !important;
  margin: 0 !important;
  transition: all 0.15s ease !important;
}

.pos-checkout-modal-footer .pos-btn-back {
  padding: 0 16px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  gap: 6px !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

.pos-checkout-modal-footer .pos-btn-back:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
}

.pos-checkout-modal-footer .pos-btn-cancel {
  padding: 0 16px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #64748b !important;
}

.pos-checkout-modal-footer .pos-btn-cancel:hover {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
}

.pos-checkout-modal-footer .pos-btn-finish {
  padding: 0 22px !important;
  font-size: 13.5px !important;
  font-weight: 750 !important;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3) !important;
  gap: 8px !important;
}

.pos-checkout-modal-footer .pos-btn-finish:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4) !important;
  transform: translateY(-1px) !important;
}

.pos-checkout-modal-footer .pos-btn-finish:active {
  transform: translateY(0) !important;
}

@media (max-width: 540px) {
  .pos-checkout-modal-footer {
    display: grid !important;
    grid-template-columns: 1.15fr 0.85fr !important;
    grid-template-areas:
      "back cancel"
      "finish finish" !important;
    gap: 10px !important;
    padding: 12px 16px 16px !important;
  }
  .pos-checkout-modal-footer .pos-btn-back {
    grid-area: back !important;
    width: 100% !important;
    padding: 0 8px !important;
    font-size: 12px !important;
    height: 42px !important;
    min-height: 42px !important;
  }
  .pos-checkout-action-right {
    display: contents !important;
  }
  .pos-checkout-modal-footer .pos-btn-cancel {
    grid-area: cancel !important;
    width: 100% !important;
    padding: 0 8px !important;
    font-size: 12px !important;
    height: 42px !important;
    min-height: 42px !important;
  }
  .pos-checkout-modal-footer .pos-btn-finish {
    grid-area: finish !important;
    width: 100% !important;
    height: 46px !important;
    min-height: 46px !important;
    font-size: 14px !important;
  }
}


/* =========================================================================
   ORDER TRACKER HEADER ACTIONS & CARD HEADER STYLING
   ========================================================================= */
.orders-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.orders-header-actions .btn-create-order {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #bfdbfe !important;
  font-weight: 750 !important;
}

.orders-header-actions .btn-create-order:hover {
  background: #dbeafe !important;
  border-color: #93c5fd !important;
  color: #1e40af !important;
}

.orders-header-actions .btn-sync-orders {
  background: #ffffff !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
  font-weight: 600 !important;
}

.orders-header-actions .btn-sync-orders:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

.order-card-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.order-detail-chip {
  font-size: 11px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
  cursor: pointer;
}

.order-detail-chip:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}

@media (max-width: 600px) {
  .orders-header-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 10px !important;
  }
  .orders-header-actions .btn-action {
    width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    justify-content: center !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 0 6px !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 540px) {
  .order-card-header {
    align-items: flex-start !important;
    gap: 10px !important;
  }
  .order-code-label {
    font-size: 13px !important;
  }
  .order-time-label {
    font-size: 10.5px !important;
  }
  .order-card-header-actions {
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 4px !important;
  }
  .order-status-badge {
    padding: 3px 8px !important;
    font-size: 10.5px !important;
    white-space: nowrap !important;
  }
  .order-detail-chip {
    padding: 2px 7px !important;
    font-size: 10px !important;
  }
}


/* =========================================================================
   BARANG MASUK SUPPLIER RESPONSIVE FORM
   ========================================================================= */
.inbound-mode-selector {
  display: inline-flex;
  border-radius: 8px;
  background: #f1f5f9;
  padding: 3px;
  border: 1px solid #e2e8f0;
  gap: 3px;
}

.inbound-mode-selector button {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.inbound-mode-selector button.active {
  background: #2563eb !important;
  color: #ffffff !important;
  font-weight: 750 !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25) !important;
}

.inbound-single-grid {
  display: grid;
  grid-template-columns: 1.1fr 110px 1.4fr;
  gap: 14px;
  margin-bottom: 12px;
  align-items: start;
}

#btnKeychainNama3DHeader {
  display: none !important;
}


.inbound-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.inbound-form-actions .btn-inbound-reset {
  height: 42px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
}

.inbound-form-actions .btn-inbound-submit {
  height: 42px;
  padding: 0 22px;
  font-size: 13.5px;
  font-weight: 750;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

@media (max-width: 600px) {
  .inbound-mode-selector {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
  }
  .inbound-mode-selector button {
    width: 100% !important;
    text-align: center !important;
    padding: 8px 6px !important;
    font-size: 12px !important;
    justify-content: center !important;
  }
  .inbound-single-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .inbound-form-actions {
    display: grid !important;
    grid-template-columns: 0.8fr 1.2fr !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .inbound-form-actions .btn {
    width: 100% !important;
    justify-content: center !important;
  }
}


/* =============================================================================
   MASTER HARGA PRODUK JADI & MASTER HPP
   ============================================================================= */
.pricing-cat-pill, .hpp-cat-pill {
  padding: 7px 14px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  border-radius: 20px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #475569 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  width: auto !important;
  flex: none !important;
  flex-shrink: 0 !important;
  line-height: 1.2 !important;
}

.pricing-cat-pill > span, .hpp-cat-pill > span {
  width: auto !important;
  display: inline !important;
  text-align: left !important;
}

.pricing-cat-pill:hover, .hpp-cat-pill:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

.pricing-cat-pill.active, .hpp-cat-pill.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.25) !important;
}

.pricing-cat-pill .filter-count-badge, .hpp-cat-pill .filter-count-badge {
  background: #e2e8f0 !important;
  color: #334155 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  padding: 2px 7px !important;
  border-radius: 12px !important;
  min-width: 18px !important;
  line-height: 1.2 !important;
  display: inline-block !important;
  text-align: center !important;
  width: auto !important;
  margin-left: 2px !important;
}

.pricing-cat-pill.active .filter-count-badge, .hpp-cat-pill.active .filter-count-badge {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

.simulator-kpi-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  background: #fafafa;
  text-align: center;
}
.simulator-kpi-item .sim-title {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 2px;
}
.simulator-kpi-item .sim-val {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}
.simulator-kpi-item.highlight {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.simulator-kpi-item.highlight .sim-title {
  color: #1d4ed8;
}
.simulator-kpi-item.highlight .sim-val {
  color: #1e40af;
  font-size: 16px;
}

/* ==========================================================================
   MODAL INVENTORY GROUP DETAIL (STOK GUDANG) - RESPONSIVE & TIDY UI
   ========================================================================== */
.modal-inv-group-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  transition: all 0.15s ease;
  gap: 12px;
}

.modal-inv-group-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.modal-inv-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.modal-inv-dot-dual {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.modal-inv-dot-dual span {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  display: inline-block;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.modal-inv-dot-dual i {
  font-size: 10px;
  color: #94a3b8;
  font-style: normal;
}

.modal-inv-dot-single {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.modal-inv-item-info {
  min-width: 0;
  flex: 1;
}

.modal-inv-item-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-inv-item-title {
  font-size: 13.5px;
  font-weight: 750;
  color: #0f172a;
  word-break: break-word;
  line-height: 1.35;
}

.modal-inv-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 6px;
  background: #e2e8f0;
  color: #475569;
  border-radius: 5px;
  line-height: 1.1;
}

.modal-inv-item-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
  word-break: break-word;
  line-height: 1.35;
}

.modal-inv-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.modal-inv-stock-pill {
  font-size: 12.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  min-width: 55px;
  text-align: center;
  display: inline-block;
}

.modal-inv-btn-group {
  display: flex;
  gap: 5px;
  align-items: center;
}

.modal-inv-btn {
  height: 28px;
  padding: 2px 9px;
  font-size: 11px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.modal-inv-btn-deduct {
  font-weight: 750;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.modal-inv-btn-deduct:hover {
  background: #fecaca;
}

.modal-inv-btn-edit {
  font-weight: 600;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
}

.modal-inv-btn-edit:hover {
  background: #f1f5f9;
}

/* Mobile Viewport Optimizations */
@media (max-width: 520px) {
  #modalInventoryGroupDetail .modal-box {
    width: 95% !important;
    max-height: 90vh !important;
    border-radius: 16px !important;
  }

  #modalInventoryGroupDetail #modalInvGroupBody {
    padding: 12px 14px !important;
    gap: 8px !important;
  }

  .modal-inv-group-item {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }

  .modal-inv-item-left {
    width: 100% !important;
    align-items: flex-start !important;
  }

  .modal-inv-item-right {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-top: 1px dashed #e2e8f0 !important;
    padding-top: 8px !important;
  }

  .modal-inv-item-title {
    font-size: 13.5px !important;
  }

  .modal-inv-stock-pill {
    padding: 3px 8px !important;
    font-size: 12px !important;
  }

  .modal-inv-btn {
    height: 28px !important;
    padding: 2px 10px !important;
    font-size: 11.5px !important;
  }
}

/* ==========================================================================
   TAB MESIN 3D PRINTER (MACHINE MANAGEMENT) STYLES
   ========================================================================== */
.machine-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.machine-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08);
  transform: translateY(-2px);
}

.machine-card.status-printing {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #f0f7ff 0%, #ffffff 40%);
}

.machine-card.status-maintenance {
  border-color: #fde68a;
  background: linear-gradient(180deg, #fffdf5 0%, #ffffff 40%);
}

.machine-card.status-offline {
  border-color: #fca5a5;
  background: linear-gradient(180deg, #fef2f2 0%, #ffffff 40%);
}

.machine-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.machine-card.status-printing .machine-card-avatar {
  background: #dbeafe;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.machine-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.machine-status-pill.printing {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.machine-status-pill.idle {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.machine-status-pill.maintenance {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.machine-status-pill.offline {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.machine-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.machine-status-pill.printing .machine-pulse-dot {
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.3);
  animation: pulseGreen 1.8s infinite;
}

.machine-status-pill.idle .machine-pulse-dot {
  background: #64748b;
}

.machine-status-pill.maintenance .machine-pulse-dot {
  background: #d97706;
}

.machine-status-pill.offline .machine-pulse-dot {
  background: #dc2626;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

@media (max-width: 640px) {
  #machinesGridContainer {
    grid-template-columns: 1fr !important;
  }
}

/* =============================================================================
   FITUR SIMPAN & MUAT PESANAN KASIR (HOLD & RECALL ORDERS)
   ============================================================================= */

#btnOpenSavedOrders {
  transition: all 0.2s ease;
}

#btnOpenSavedOrders:hover {
  background: #fef3c7 !important;
  border-color: #f59e0b !important;
  color: #78350f !important;
  transform: translateY(-1px);
}

#btnSaveCustomizerOrder {
  transition: all 0.2s ease;
}

#btnSaveCustomizerOrder:hover {
  background: #fde68a !important;
  border-color: #d97706 !important;
  color: #78350f !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.2);
}

.saved-order-card {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.saved-order-card:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 6px 16px -2px rgba(15, 23, 42, 0.08) !important;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .cust-action-buttons-row {
    flex-wrap: wrap;
  }
  #btnSaveCustomizerOrder {
    order: 3;
    flex: 1 1 calc(50% - 6px);
  }
  #btnPosCheckout {
    order: 4;
    width: 100% !important;
    flex: 1 1 100% !important;
  }
}

/* Sembunyikan permanen Menu Lab & Uji Coba dari Sidebar POS */
#navGroupLabUjiCoba,
.lab-desktop-only {
  display: none !important;
}

/* =============================================================================
   SUB-TAB NAV PERAKITAN PRODUK (BOM & ASSEMBLY)
   ============================================================================= */
.assembly-subtab-track {
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  display: inline-flex;
  gap: 4px;
  border: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.assembly-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.assembly-subtab-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.assembly-subtab-btn.active {
  background: #2563eb !important;
  color: #ffffff !important;
  font-weight: 750 !important;
  border: 1px solid #1d4ed8 !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3) !important;
}

/* =============================================================================
   KOLAM PERMINTAAN CETAK & SMART BATCH CONSOLIDATION
   ============================================================================= */
.req-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 768px) {
  .req-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.req-kpi-card {
  padding: 12px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.req-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.req-kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.req-kpi-info {
  display: flex;
  flex-direction: column;
}
.req-kpi-label {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.req-kpi-val {
  font-size: 15px;
  font-weight: 800;
  margin-top: 2px;
}

/* Floating Batch Action Bar */
.floating-batch-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 50px;
  box-shadow: 0 20px 35px -5px rgba(15, 23, 42, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  max-width: 90vw;
}
.floating-batch-bar.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.floating-batch-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.floating-batch-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-floating-consolidate {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, transform 0.1s;
}
.btn-floating-consolidate:hover {
  background: #1d4ed8;
  transform: scale(1.02);
}
.btn-floating-cancel {
  background: rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  border: none;
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-floating-cancel:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Badge Urgensi */
.badge-urgency-urgent {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-urgency-normal {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-urgency-buffer {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-urgency-batched {
  background: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Standard Numeric Input Styling for BOM Recipe & Stepper */
input.part-qty::-webkit-outer-spin-button,
input.part-qty::-webkit-inner-spin-button,
input.hw-qty::-webkit-outer-spin-button,
input.hw-qty::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}
input.part-qty, input.hw-qty {
  -moz-appearance: textfield !important;
}
input.part-qty::placeholder, input.hw-qty::placeholder {
  color: #94a3b8;
  font-weight: 500;
}



