.custom-context-menu {
  position: fixed;
  z-index: 10000;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 12px;
  padding: 8px 0;
  min-width: 200px;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: none;
  opacity: 0;
  transform: scale(0.95) translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.custom-context-menu.active {
  display: block;
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}

tr.custom-context-menu-active-row > * {
  background-color: rgba(13, 110, 253, 0.12) !important;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

tr.custom-context-menu-active-row > :first-child {
  box-shadow: inset 4px 0 0 rgba(13, 110, 253, 0.7) !important;
}

.custom-context-menu-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  color: #333;
  font-size: 14px;
  gap: 12px;
}

.custom-context-menu-item:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.custom-context-menu-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.custom-context-menu-item i {
  width: 18px;
  text-align: center;
  font-size: 16px;
}

.custom-context-menu-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.custom-context-menu-label {
  padding: 6px 16px 4px;
  color: #6c757d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.custom-context-menu-row-actions {
  max-height: 240px;
  overflow-y: auto;
}

.custom-context-menu-row-action-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-context-menu-divider {
  height: 1px;
  background-color: rgba(0, 0, 0, 0.1);
  margin: 4px 0;
}
html.dark-mode .custom-context-menu {
  background: rgba(30, 30, 30, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

html.dark-mode tr.custom-context-menu-active-row > *,
body.dark-mode tr.custom-context-menu-active-row > * {
  background-color: rgba(77, 171, 247, 0.2) !important;
}

html.dark-mode tr.custom-context-menu-active-row > :first-child,
body.dark-mode tr.custom-context-menu-active-row > :first-child {
  box-shadow: inset 4px 0 0 rgba(77, 171, 247, 0.75) !important;
}

html.dark-mode .custom-context-menu-item {
  color: #e0e0e0;
}

html.dark-mode .custom-context-menu-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

html.dark-mode .custom-context-menu-label {
  color: #a0a0a0;
}

html.dark-mode .custom-context-menu-divider {
  background-color: rgba(255, 255, 255, 0.1);
}
.custom-context-menu {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
input:not([readonly]):not([disabled]),
textarea:not([readonly]):not([disabled]) {
  -webkit-touch-callout: none;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}
@media (max-width: 768px) {
  .custom-context-menu {
    min-width: 180px;
    max-width: calc(100vw - 20px);
    padding: 4px 0;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
  }

  .custom-context-menu-item {
    padding: 14px 20px;
    font-size: 16px;
    gap: 16px;
    min-height: 48px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  }

  .custom-context-menu-item:active {
    background-color: rgba(0, 0, 0, 0.15);
  }

  .custom-context-menu-item i {
    width: 20px;
    font-size: 18px;
  }

  .custom-context-menu-item svg {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }

  .custom-context-menu-label {
    padding: 8px 20px 4px;
    font-size: 12px;
  }

  .custom-context-menu-divider {
    margin: 6px 0;
  }
}

@media (max-width: 480px) {
  .custom-context-menu {
    min-width: 160px;
    max-width: calc(100vw - 16px);
    border-radius: 14px;
  }

  .custom-context-menu-item {
    padding: 12px 18px;
    font-size: 15px;
    gap: 14px;
    min-height: 44px;
  }

  .custom-context-menu-item i {
    width: 18px;
    font-size: 16px;
  }

  .custom-context-menu-item svg {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }
}
