/* Custom select: native input retained for form submission */
.ui-select {
  display: inline-block;
  min-width: 130px;
  max-width: 100%;
  vertical-align: middle;
  position: relative;
}
.ui-select > select {
  display: none !important;
}
.ui-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px !important;
  background: #ffffff !important;
  border: 1px solid #d8e1d2 !important;
  border-radius: 14px !important;
  padding: 10px 12px !important;
  font-size: 12px !important;
  color: #37533d !important;
  text-align: left;
  box-shadow: none !important;
}
.ui-select-trigger:after {
  content: '⌄';
  font-size: 16px;
  color: #7d906d;
}
.ui-select-trigger[aria-expanded="true"] {
  border-color: #93a97a !important;
  box-shadow: 0 0 0 3px rgba(155, 173, 121, 0.12) !important;
}
.ui-select-menu {
  position: fixed;
  z-index: 60000;
  max-height: min(280px, 50vh);
  overflow: auto;
  padding: 6px;
  background: #fffef9;
  border: 1px solid #d5dfc9;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(24, 58, 36, 0.16);
  scrollbar-width: thin;
}
.ui-select-option {
  display: block;
  width: 100%;
  border: 0 !important;
  border-radius: 10px !important;
  padding: 10px 12px !important;
  font-size: 12px !important;
  line-height: 1.6;
  text-align: left;
  background: transparent !important;
  color: #526648 !important;
  box-shadow: none !important;
  transform: none !important;
}
.ui-select-option[aria-selected="true"] {
  background: #e9f0df !important;
  color: #335537 !important;
  font-weight: 700;
}
.ui-select-option:hover,
.ui-select-option:focus-visible {
  background: #f0f4e8 !important;
  outline: 2px solid #a8b98d;
  outline-offset: -2px;
}
.ui-select:has(select[style*="width: 100%"]) {
  display: block;
  width: 100%;
}
.stock-form-card .ui-select,
.form-group .ui-select {
  width: 100%;
}
.ui-select-menu button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* WhatsApp Center Styles */
.btn-wa-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #25D366;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.70rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.25);
}
.btn-wa-action:hover {
  background: #1eb857;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 211, 102, 0.35);
}
.btn-wa-action svg {
  flex-shrink: 0;
}
.badge-wa-contacted {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  padding: 2px 7px;
  border-radius: 5px;
}
.badge-wa-pending {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
  padding: 2px 7px;
  border-radius: 5px;
}
.wa-var-chip {
  background: #fdfaf7;
  border: 1px solid #e8decb;
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 0.72rem;
  font-family: monospace;
  color: #854d0e;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.wa-var-chip:hover {
  background: #fef08a;
  border-color: #facc15;
  color: #713f12;
}
.wa-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}
.wa-tab-btn:hover {
  color: #1f2937;
}
.wa-tab-btn.active {
  color: #059669;
  border-bottom-color: #059669;
  font-weight: 700;
}

@media (max-width: 768px) {
  .ui-select {
    width: 100%;
  }
  .ui-select-trigger {
    min-height: 44px !important;
    font-size: 14px !important;
  }
  .ui-select-menu {
    max-height: min(280px, 45dvh);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .ui-select-option {
    padding: 12px 14px !important;
    font-size: 14px !important;
    min-height: 42px;
  }
  .wa-tab-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
}

/* Scoped staff privilege action buttons, visual only */
#subpanel-staff-privilege .privilege-footer-actions,#subpanel-staff-privilege .privilege-footer-left,#subpanel-staff-privilege .privilege-footer-right{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
#subpanel-staff-privilege .privilege-footer-actions{justify-content:space-between}
#subpanel-staff-privilege .privilege-footer-left{flex:1 1 420px}
#subpanel-staff-privilege .privilege-footer-right{flex:0 1 auto}
#subpanel-staff-privilege .privilege-footer-actions button{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:7px!important;width:auto!important;max-width:100%;min-height:40px!important;padding:9px 15px!important;border-radius:11px!important;font-size:12px!important;line-height:1.4!important;font-weight:650!important;white-space:normal;text-align:center;box-sizing:border-box}
#subpanel-staff-privilege #btnSavePrivileges{background:#75472d!important;border:1px solid #75472d!important;color:white!important;min-width:175px}
#subpanel-staff-privilege #btnSavePrivileges svg{flex-shrink:0;margin:0!important}
@media(max-width:700px){#subpanel-staff-privilege .privilege-footer-left,#subpanel-staff-privilege .privilege-footer-right{flex:1 1 100%}#subpanel-staff-privilege .privilege-footer-left button{flex:1 1 145px}#subpanel-staff-privilege #btnSavePrivileges{width:100%!important}}

#staffTableBody a.staff-manage-account-btn {
 display:inline-flex!important;align-items:center!important;justify-content:center!important;
 min-height:40px!important;min-width:124px!important;width:auto!important;
 padding:9px 16px!important;box-sizing:border-box!important;
 border:1px solid #75472d!important;border-radius:10px!important;
 background:#75472d!important;color:#fff!important;font-size:12px!important;
 font-weight:650!important;line-height:1.3!important;text-align:center!important;
 text-decoration:none!important;white-space:nowrap!important;box-shadow:none!important;
}
#staffTableBody a.staff-manage-account-btn:hover,
#staffTableBody a.staff-manage-account-btn:focus-visible {
 background:#5d3622!important;border-color:#5d3622!important;color:#fff!important;
}
#staffTableBody td:last-child {text-align:center;vertical-align:middle;}
@media(max-width:600px) {
 #staffTableBody a.staff-manage-account-btn {min-height:44px!important;min-width:112px!important;padding:10px 12px!important;}
}

/* ==============================================================================
   PAGINATION STYLING (ZETTBOT HIGH PERFORMANCE & ANTI-AI HUMAN CRAFTED LOOK)
   ============================================================================== */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 18px;
  background: var(--card-bg, #fdfaf7);
  border: 1.5px solid var(--card-border, #ebdcd0);
  border-top: none;
  border-radius: 0 0 16px 16px;
  font-size: 0.82rem;
  color: var(--text-muted, #78716c);
  box-sizing: border-box;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.pagination-info {
  font-size: 0.80rem;
  color: var(--text-muted, #78716c);
  font-weight: 600;
}
.pagination-info strong {
  color: var(--text-main, #2b1810);
}
.pagination-buttons {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.btn-pagination-nav, .btn-pagination-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1.5px solid var(--card-border, #dcd2c8);
  background: var(--card-bg, #ffffff);
  color: var(--text-main, #475569);
  font-size: 0.80rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}
.btn-pagination-nav:hover:not([disabled]), .btn-pagination-num:hover:not(.active) {
  background: #f5ebe1;
  border-color: #9c5a3c;
  color: #211511;
  transform: translateY(-1px);
}
.btn-pagination-num.active {
  background: #9c5a3c !important;
  border-color: #9c5a3c !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(156, 90, 60, 0.35);
}
.btn-pagination-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--canvas-subtle, #f8fafc);
  border-color: var(--card-border, #e2e8f0);
}
.pagination-ellipsis {
  padding: 0 4px;
  color: var(--text-muted, #94a3b8);
  font-weight: 700;
}
@media (max-width: 680px) {
  .pagination-container {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 10px;
  }
  .pagination-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* ==========================================================================
   NETWORK STATUS COMPONENT & PULSING GLOW DOT INDICATOR
   ========================================================================== */

.connection-banner-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  margin-bottom: 24px;
  border-radius: 14px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Mode ONLINE (Default Light) */
.connection-banner-card.is-online {
  background: linear-gradient(135deg, #f0fdf4 0%, #f4fbf6 100%);
  border: 1.5px solid #bbf7d0;
  color: #166534;
}

/* Mode OFFLINE (Default Light) */
.connection-banner-card.is-offline {
  background: linear-gradient(135deg, #fef2f2 0%, #fff5f5 100%);
  border: 1.5px solid #fecaca;
  color: #991b1b;
}

.connection-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

/* Pulsing Indicator Container */
.pulse-indicator-wrap {
  position: relative;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Static Core Dot */
.pulse-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Animated Glowing Outer Ring */
.pulse-glow-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

/* ONLINE Glow Animations */
.connection-banner-card.is-online .pulse-status-dot {
  background-color: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8), 0 0 16px rgba(16, 185, 129, 0.4);
}

.connection-banner-card.is-online .pulse-glow-ring {
  animation: pulseGreenWave 2.4s infinite cubic-bezier(0.24, 0, 0.38, 1);
  background-color: rgba(16, 185, 129, 0.45);
}

@keyframes pulseGreenWave {
  0% {
    transform: scale(0.6);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.35;
  }
  100% {
    transform: scale(1.85);
    opacity: 0;
  }
}

/* OFFLINE Glow Animations (Rapid Alert Pulse) */
.connection-banner-card.is-offline .pulse-status-dot {
  background-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.9), 0 0 20px rgba(239, 68, 68, 0.5);
}

.connection-banner-card.is-offline .pulse-glow-ring {
  animation: pulseRedWave 1.2s infinite cubic-bezier(0.25, 0.1, 0.25, 1);
  background-color: rgba(239, 68, 68, 0.55);
}

@keyframes pulseRedWave {
  0% {
    transform: scale(0.6);
    opacity: 0.95;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.4;
  }
  100% {
    transform: scale(2.0);
    opacity: 0;
  }
}

/* Info & Badges */
.connection-banner-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.connection-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.25s ease;
}

.connection-banner-card.is-online .connection-badge-pill {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.connection-banner-card.is-offline .connection-badge-pill {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.connection-sim-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  text-transform: uppercase;
  animation: pulseSimBadge 2s infinite ease-in-out;
}

@keyframes pulseSimBadge {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.6; }
}

.connection-status-msg-wrap {
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
}

.connection-status-msg {
  display: inline-block;
  font-size: 12px;
  line-height: 1.4;
  color: inherit;
  font-weight: 500;
}

/* Action Simulation Button */
.connection-banner-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.btn-network-sim {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1.5px solid transparent;
  user-select: none;
}

/* State button saat online (siap uji offline) */
.connection-banner-card.is-online .btn-network-sim {
  background: #ffffff;
  color: #374151;
  border-color: #d1d5db;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.connection-banner-card.is-online .btn-network-sim:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #111827;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

/* State button saat simulasi aktif / offline */
.btn-network-sim.is-active-sim,
.connection-banner-card.is-offline .btn-network-sim {
  background: #b91c1c;
  color: #ffffff;
  border-color: #991b1b;
  box-shadow: 0 2px 6px rgba(185, 28, 28, 0.3);
}

.btn-network-sim.is-active-sim:hover,
.connection-banner-card.is-offline .btn-network-sim:hover {
  background: #991b1b;
  border-color: #7f1d1d;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(153, 27, 27, 0.4);
}

.sim-btn-icon {
  font-size: 13px;
  line-height: 1;
}

/* Mobile Responsiveness */
@media (max-width: 680px) {
  .connection-banner-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 14px;
  }
  .connection-banner-actions {
    justify-content: flex-end;
  }
  .btn-network-sim {
    width: 100%;
    justify-content: center;
    padding: 9px 12px;
  }
}

/* Hide during print */
@media print {
  .connection-banner-card,
  .staff-online-pill-wrap {
    display: none !important;
  }
}

/* ==========================================================================
   ONLINE STAFF MONITOR WIDGET & DROPDOWN (OWNER & PRIVILEGED ADMIN)
   ========================================================================== */

.staff-online-pill-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.staff-online-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #ffffff;
  border: 1.5px solid #d4e3cb;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 700;
  color: #27472c;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  user-select: none;
}

.staff-online-pill:hover,
.staff-online-pill[aria-expanded="true"] {
  background: #f4f9f1;
  border-color: #8bb37e;
  color: #1b381f;
  box-shadow: 0 3px 8px rgba(39, 71, 44, 0.12);
  transform: translateY(-1px);
}

.staff-online-pulse-wrap {
  position: relative;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.staff-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
  position: relative;
  z-index: 2;
}

.staff-online-pulse-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.45);
  animation: pulseStaffGreen 2.2s infinite ease-out;
  pointer-events: none;
  z-index: 1;
}

@keyframes pulseStaffGreen {
  0% { transform: scale(0.6); opacity: 0.9; }
  50% { transform: scale(1.4); opacity: 0.35; }
  100% { transform: scale(1.9); opacity: 0; }
}

.staff-online-label {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.staff-online-chevron {
  transition: transform 0.2s ease;
  color: #708a68;
}

.staff-online-pill[aria-expanded="true"] .staff-online-chevron {
  transform: rotate(180deg);
}

/* Dropdown Card */
.staff-online-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 310px;
  max-width: 90vw;
  background: #fffefb;
  border: 1.5px solid #dce8d3;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(19, 44, 25, 0.16);
  z-index: 1200;
  overflow: hidden;
  animation: fadeInStaffDropdown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInStaffDropdown {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.staff-online-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f4f8f0;
  border-bottom: 1px solid #e2ebd8;
}

.staff-online-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #1e3d23;
}

.staff-online-header-badge {
  font-size: 10px;
  font-weight: 800;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
  border-radius: 9999px;
  padding: 2px 7px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.staff-online-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
}

.staff-online-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.staff-online-item:hover {
  background: #f7faf3;
}

.staff-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e5ede0;
  color: #27472c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  position: relative;
  flex-shrink: 0;
  border: 1.5px solid #c7d8be;
}

.staff-avatar-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  border: 1.5px solid #ffffff;
}

.staff-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.staff-item-top {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: space-between;
}

.staff-item-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.staff-item-name .staff-you-tag {
  font-size: 10px;
  font-weight: 600;
  color: #059669;
  background: #ecfdf5;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
}

.staff-item-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.staff-role-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.staff-role-owner { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.staff-role-admin { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }
.staff-role-kasir { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.staff-role-gudang { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; }

.staff-time-active {
  color: #6b7280;
  font-size: 10.5px;
}

.staff-online-empty {
  padding: 24px 16px;
  text-align: center;
  color: #6b7280;
  font-size: 12px;
}

.staff-online-dropdown-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #fafdf7;
  border-top: 1px solid #e8f0e0;
  font-size: 11px;
  color: #688264;
}

.btn-refresh-staff-online {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  color: #557250;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-refresh-staff-online:hover {
  background: #e8f2e2;
  color: #1b381f;
  transform: rotate(45deg);
}


